| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| // | ||
| // Copyright(C) 2021 Advanced Micro Devices, Inc. | ||
| // | ||
| // All rights reserved. | ||
| // | ||
| // Redistribution and use in source and binary forms, with or without | ||
| // modification, are permitted provided that the following conditions | ||
| // are met: | ||
| // | ||
| // Redistributions of source code must retain the above copyright | ||
| // notice, this list of conditions and the following disclaimer. | ||
| // | ||
| // Redistributions in binary form must reproduce the above | ||
| // copyright notice, this list of conditions and the following | ||
| // disclaimer in the documentation and/or other materials provided | ||
| // with the distribution. | ||
| // | ||
| // Neither the name of 3Dlabs Inc. Ltd. nor the names of its | ||
| // contributors may be used to endorse or promote products derived | ||
| // from this software without specific prior written permission. | ||
| // | ||
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
| // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
| // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
| // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
| // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
| // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| // POSSIBILITY OF SUCH DAMAGE. | ||
| // | ||
|
|
||
| #pragma once | ||
|
|
||
| #ifndef GLSLANG_WEB | ||
|
|
||
| // | ||
| // GL_EXT_spirv_intrinsics | ||
| // | ||
| #include "Common.h" | ||
|
|
||
| namespace glslang { | ||
|
|
||
| class TIntermTyped; | ||
| class TIntermConstantUnion; | ||
| class TType; | ||
|
|
||
| // SPIR-V requirements | ||
| struct TSpirvRequirement { | ||
| POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) | ||
|
|
||
| // capability = [..] | ||
| TSet<TString> extensions; | ||
| // extension = [..] | ||
| TSet<int> capabilities; | ||
| }; | ||
|
|
||
| // SPIR-V execution modes | ||
| struct TSpirvExecutionMode { | ||
| POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) | ||
|
|
||
| // spirv_execution_mode | ||
| TMap<int, TVector<const TIntermConstantUnion*>> modes; | ||
| // spirv_execution_mode_id | ||
| TMap<int, TVector<const TIntermTyped*> > modeIds; | ||
| }; | ||
|
|
||
| // SPIR-V decorations | ||
| struct TSpirvDecorate { | ||
| POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) | ||
|
|
||
| // spirv_decorate | ||
| TMap<int, TVector<const TIntermConstantUnion*> > decorates; | ||
| // spirv_decorate_id | ||
| TMap<int, TVector<const TIntermTyped*>> decorateIds; | ||
| // spirv_decorate_string | ||
| TMap<int, TVector<const TIntermConstantUnion*> > decorateStrings; | ||
| }; | ||
|
|
||
| // SPIR-V instruction | ||
| struct TSpirvInstruction { | ||
| POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) | ||
|
|
||
| TSpirvInstruction() { set = ""; id = -1; } | ||
|
|
||
| bool operator==(const TSpirvInstruction& rhs) const { return set == rhs.set && id == rhs.id; } | ||
| bool operator!=(const TSpirvInstruction& rhs) const { return !operator==(rhs); } | ||
|
|
||
| // spirv_instruction | ||
| TString set; | ||
| int id; | ||
| }; | ||
|
|
||
| // SPIR-V type parameter | ||
| struct TSpirvTypeParameter { | ||
| POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) | ||
|
|
||
| TSpirvTypeParameter(const TIntermConstantUnion* arg) { constant = arg; } | ||
|
|
||
| bool operator==(const TSpirvTypeParameter& rhs) const { return constant == rhs.constant; } | ||
| bool operator!=(const TSpirvTypeParameter& rhs) const { return !operator==(rhs); } | ||
|
|
||
| const TIntermConstantUnion* constant; | ||
| }; | ||
|
|
||
| typedef TVector<TSpirvTypeParameter> TSpirvTypeParameters; | ||
|
|
||
| // SPIR-V type | ||
| struct TSpirvType { | ||
| POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) | ||
|
|
||
| bool operator==(const TSpirvType& rhs) const | ||
| { | ||
| return spirvInst == rhs.spirvInst && typeParams == rhs.typeParams; | ||
| } | ||
| bool operator!=(const TSpirvType& rhs) const { return !operator==(rhs); } | ||
|
|
||
| // spirv_type | ||
| TSpirvInstruction spirvInst; | ||
| TSpirvTypeParameters typeParams; | ||
| }; | ||
|
|
||
| } // end namespace glslang | ||
|
|
||
| #endif // GLSLANG_WEB |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,254 @@ | ||
| /** | ||
| This code is based on the glslang_c_interface implementation by Viktor Latypov | ||
| **/ | ||
|
|
||
| /** | ||
| BSD 2-Clause License | ||
| Copyright (c) 2019, Viktor Latypov | ||
| All rights reserved. | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
| 1. Redistributions of source code must retain the above copyright notice, this | ||
| list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimer in the documentation | ||
| and/or other materials provided with the distribution. | ||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
| FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| **/ | ||
|
|
||
| #ifndef GLSLANG_C_IFACE_H_INCLUDED | ||
| #define GLSLANG_C_IFACE_H_INCLUDED | ||
|
|
||
| #include <stdbool.h> | ||
| #include <stdlib.h> | ||
|
|
||
| #include "glslang_c_shader_types.h" | ||
|
|
||
| typedef struct glslang_shader_s glslang_shader_t; | ||
| typedef struct glslang_program_s glslang_program_t; | ||
|
|
||
| /* TLimits counterpart */ | ||
| typedef struct glslang_limits_s { | ||
| bool non_inductive_for_loops; | ||
| bool while_loops; | ||
| bool do_while_loops; | ||
| bool general_uniform_indexing; | ||
| bool general_attribute_matrix_vector_indexing; | ||
| bool general_varying_indexing; | ||
| bool general_sampler_indexing; | ||
| bool general_variable_indexing; | ||
| bool general_constant_matrix_vector_indexing; | ||
| } glslang_limits_t; | ||
|
|
||
| /* TBuiltInResource counterpart */ | ||
| typedef struct glslang_resource_s { | ||
| int max_lights; | ||
| int max_clip_planes; | ||
| int max_texture_units; | ||
| int max_texture_coords; | ||
| int max_vertex_attribs; | ||
| int max_vertex_uniform_components; | ||
| int max_varying_floats; | ||
| int max_vertex_texture_image_units; | ||
| int max_combined_texture_image_units; | ||
| int max_texture_image_units; | ||
| int max_fragment_uniform_components; | ||
| int max_draw_buffers; | ||
| int max_vertex_uniform_vectors; | ||
| int max_varying_vectors; | ||
| int max_fragment_uniform_vectors; | ||
| int max_vertex_output_vectors; | ||
| int max_fragment_input_vectors; | ||
| int min_program_texel_offset; | ||
| int max_program_texel_offset; | ||
| int max_clip_distances; | ||
| int max_compute_work_group_count_x; | ||
| int max_compute_work_group_count_y; | ||
| int max_compute_work_group_count_z; | ||
| int max_compute_work_group_size_x; | ||
| int max_compute_work_group_size_y; | ||
| int max_compute_work_group_size_z; | ||
| int max_compute_uniform_components; | ||
| int max_compute_texture_image_units; | ||
| int max_compute_image_uniforms; | ||
| int max_compute_atomic_counters; | ||
| int max_compute_atomic_counter_buffers; | ||
| int max_varying_components; | ||
| int max_vertex_output_components; | ||
| int max_geometry_input_components; | ||
| int max_geometry_output_components; | ||
| int max_fragment_input_components; | ||
| int max_image_units; | ||
| int max_combined_image_units_and_fragment_outputs; | ||
| int max_combined_shader_output_resources; | ||
| int max_image_samples; | ||
| int max_vertex_image_uniforms; | ||
| int max_tess_control_image_uniforms; | ||
| int max_tess_evaluation_image_uniforms; | ||
| int max_geometry_image_uniforms; | ||
| int max_fragment_image_uniforms; | ||
| int max_combined_image_uniforms; | ||
| int max_geometry_texture_image_units; | ||
| int max_geometry_output_vertices; | ||
| int max_geometry_total_output_components; | ||
| int max_geometry_uniform_components; | ||
| int max_geometry_varying_components; | ||
| int max_tess_control_input_components; | ||
| int max_tess_control_output_components; | ||
| int max_tess_control_texture_image_units; | ||
| int max_tess_control_uniform_components; | ||
| int max_tess_control_total_output_components; | ||
| int max_tess_evaluation_input_components; | ||
| int max_tess_evaluation_output_components; | ||
| int max_tess_evaluation_texture_image_units; | ||
| int max_tess_evaluation_uniform_components; | ||
| int max_tess_patch_components; | ||
| int max_patch_vertices; | ||
| int max_tess_gen_level; | ||
| int max_viewports; | ||
| int max_vertex_atomic_counters; | ||
| int max_tess_control_atomic_counters; | ||
| int max_tess_evaluation_atomic_counters; | ||
| int max_geometry_atomic_counters; | ||
| int max_fragment_atomic_counters; | ||
| int max_combined_atomic_counters; | ||
| int max_atomic_counter_bindings; | ||
| int max_vertex_atomic_counter_buffers; | ||
| int max_tess_control_atomic_counter_buffers; | ||
| int max_tess_evaluation_atomic_counter_buffers; | ||
| int max_geometry_atomic_counter_buffers; | ||
| int max_fragment_atomic_counter_buffers; | ||
| int max_combined_atomic_counter_buffers; | ||
| int max_atomic_counter_buffer_size; | ||
| int max_transform_feedback_buffers; | ||
| int max_transform_feedback_interleaved_components; | ||
| int max_cull_distances; | ||
| int max_combined_clip_and_cull_distances; | ||
| int max_samples; | ||
| int max_mesh_output_vertices_nv; | ||
| int max_mesh_output_primitives_nv; | ||
| int max_mesh_work_group_size_x_nv; | ||
| int max_mesh_work_group_size_y_nv; | ||
| int max_mesh_work_group_size_z_nv; | ||
| int max_task_work_group_size_x_nv; | ||
| int max_task_work_group_size_y_nv; | ||
| int max_task_work_group_size_z_nv; | ||
| int max_mesh_view_count_nv; | ||
| int maxDualSourceDrawBuffersEXT; | ||
|
|
||
| glslang_limits_t limits; | ||
| } glslang_resource_t; | ||
|
|
||
| typedef struct glslang_input_s { | ||
| glslang_source_t language; | ||
| glslang_stage_t stage; | ||
| glslang_client_t client; | ||
| glslang_target_client_version_t client_version; | ||
| glslang_target_language_t target_language; | ||
| glslang_target_language_version_t target_language_version; | ||
| /** Shader source code */ | ||
| const char* code; | ||
| int default_version; | ||
| glslang_profile_t default_profile; | ||
| int force_default_version_and_profile; | ||
| int forward_compatible; | ||
| glslang_messages_t messages; | ||
| const glslang_resource_t* resource; | ||
| } glslang_input_t; | ||
|
|
||
| /* Inclusion result structure allocated by C include_local/include_system callbacks */ | ||
| typedef struct glsl_include_result_s { | ||
| /* Header file name or NULL if inclusion failed */ | ||
| const char* header_name; | ||
|
|
||
| /* Header contents or NULL */ | ||
| const char* header_data; | ||
| size_t header_length; | ||
|
|
||
| } glsl_include_result_t; | ||
|
|
||
| /* Callback for local file inclusion */ | ||
| typedef glsl_include_result_t* (*glsl_include_local_func)(void* ctx, const char* header_name, const char* includer_name, | ||
| size_t include_depth); | ||
|
|
||
| /* Callback for system file inclusion */ | ||
| typedef glsl_include_result_t* (*glsl_include_system_func)(void* ctx, const char* header_name, | ||
| const char* includer_name, size_t include_depth); | ||
|
|
||
| /* Callback for include result destruction */ | ||
| typedef int (*glsl_free_include_result_func)(void* ctx, glsl_include_result_t* result); | ||
|
|
||
| /* Collection of callbacks for GLSL preprocessor */ | ||
| typedef struct glsl_include_callbacks_s { | ||
| glsl_include_system_func include_system; | ||
| glsl_include_local_func include_local; | ||
| glsl_free_include_result_func free_include_result; | ||
| } glsl_include_callbacks_t; | ||
|
|
||
| #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 int glslang_initialize_process(); | ||
| GLSLANG_EXPORT void glslang_finalize_process(); | ||
|
|
||
| GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input); | ||
| GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader); | ||
| GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base); | ||
| GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set); | ||
| GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options); // glslang_shader_options_t | ||
| GLSLANG_EXPORT void glslang_shader_set_glsl_version(glslang_shader_t* shader, int version); | ||
| GLSLANG_EXPORT 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 const char* glslang_shader_get_info_log(glslang_shader_t* shader); | ||
| GLSLANG_EXPORT const char* glslang_shader_get_info_debug_log(glslang_shader_t* shader); | ||
|
|
||
| GLSLANG_EXPORT glslang_program_t* glslang_program_create(); | ||
| GLSLANG_EXPORT void glslang_program_delete(glslang_program_t* program); | ||
| GLSLANG_EXPORT void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader); | ||
| GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages); // glslang_messages_t | ||
| GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program); | ||
| GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage); | ||
| GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program); | ||
| GLSLANG_EXPORT void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int*); | ||
| GLSLANG_EXPORT unsigned int* glslang_program_SPIRV_get_ptr(glslang_program_t* program); | ||
| GLSLANG_EXPORT const char* glslang_program_SPIRV_get_messages(glslang_program_t* program); | ||
| GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program); | ||
| GLSLANG_EXPORT const char* glslang_program_get_info_debug_log(glslang_program_t* program); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* #ifdef GLSLANG_C_IFACE_INCLUDED */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,211 @@ | ||
| /** | ||
| This code is based on the glslang_c_interface implementation by Viktor Latypov | ||
| **/ | ||
|
|
||
| /** | ||
| BSD 2-Clause License | ||
| Copyright (c) 2019, Viktor Latypov | ||
| All rights reserved. | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are met: | ||
| 1. Redistributions of source code must retain the above copyright notice, this | ||
| list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| this list of conditions and the following disclaimer in the documentation | ||
| and/or other materials provided with the distribution. | ||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
| FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| **/ | ||
|
|
||
| #ifndef C_SHADER_TYPES_H_INCLUDED | ||
| #define C_SHADER_TYPES_H_INCLUDED | ||
|
|
||
| #define LAST_ELEMENT_MARKER(x) x | ||
|
|
||
| /* EShLanguage counterpart */ | ||
| typedef enum { | ||
| GLSLANG_STAGE_VERTEX, | ||
| GLSLANG_STAGE_TESSCONTROL, | ||
| GLSLANG_STAGE_TESSEVALUATION, | ||
| GLSLANG_STAGE_GEOMETRY, | ||
| GLSLANG_STAGE_FRAGMENT, | ||
| GLSLANG_STAGE_COMPUTE, | ||
| GLSLANG_STAGE_RAYGEN_NV, | ||
| GLSLANG_STAGE_INTERSECT_NV, | ||
| GLSLANG_STAGE_ANYHIT_NV, | ||
| GLSLANG_STAGE_CLOSESTHIT_NV, | ||
| GLSLANG_STAGE_MISS_NV, | ||
| GLSLANG_STAGE_CALLABLE_NV, | ||
| GLSLANG_STAGE_TASK_NV, | ||
| GLSLANG_STAGE_MESH_NV, | ||
| LAST_ELEMENT_MARKER(GLSLANG_STAGE_COUNT), | ||
| } glslang_stage_t; // would be better as stage, but this is ancient now | ||
|
|
||
| /* EShLanguageMask counterpart */ | ||
| typedef enum { | ||
| GLSLANG_STAGE_VERTEX_MASK = (1 << GLSLANG_STAGE_VERTEX), | ||
| GLSLANG_STAGE_TESSCONTROL_MASK = (1 << GLSLANG_STAGE_TESSCONTROL), | ||
| GLSLANG_STAGE_TESSEVALUATION_MASK = (1 << GLSLANG_STAGE_TESSEVALUATION), | ||
| GLSLANG_STAGE_GEOMETRY_MASK = (1 << GLSLANG_STAGE_GEOMETRY), | ||
| GLSLANG_STAGE_FRAGMENT_MASK = (1 << GLSLANG_STAGE_FRAGMENT), | ||
| GLSLANG_STAGE_COMPUTE_MASK = (1 << GLSLANG_STAGE_COMPUTE), | ||
| GLSLANG_STAGE_RAYGEN_NV_MASK = (1 << GLSLANG_STAGE_RAYGEN_NV), | ||
| GLSLANG_STAGE_INTERSECT_NV_MASK = (1 << GLSLANG_STAGE_INTERSECT_NV), | ||
| GLSLANG_STAGE_ANYHIT_NV_MASK = (1 << GLSLANG_STAGE_ANYHIT_NV), | ||
| GLSLANG_STAGE_CLOSESTHIT_NV_MASK = (1 << GLSLANG_STAGE_CLOSESTHIT_NV), | ||
| GLSLANG_STAGE_MISS_NV_MASK = (1 << GLSLANG_STAGE_MISS_NV), | ||
| GLSLANG_STAGE_CALLABLE_NV_MASK = (1 << GLSLANG_STAGE_CALLABLE_NV), | ||
| GLSLANG_STAGE_TASK_NV_MASK = (1 << GLSLANG_STAGE_TASK_NV), | ||
| GLSLANG_STAGE_MESH_NV_MASK = (1 << GLSLANG_STAGE_MESH_NV), | ||
| LAST_ELEMENT_MARKER(GLSLANG_STAGE_MASK_COUNT), | ||
| } glslang_stage_mask_t; | ||
|
|
||
| /* EShSource counterpart */ | ||
| typedef enum { | ||
| GLSLANG_SOURCE_NONE, | ||
| GLSLANG_SOURCE_GLSL, | ||
| GLSLANG_SOURCE_HLSL, | ||
| LAST_ELEMENT_MARKER(GLSLANG_SOURCE_COUNT), | ||
| } glslang_source_t; | ||
|
|
||
| /* EShClient counterpart */ | ||
| typedef enum { | ||
| GLSLANG_CLIENT_NONE, | ||
| GLSLANG_CLIENT_VULKAN, | ||
| GLSLANG_CLIENT_OPENGL, | ||
| LAST_ELEMENT_MARKER(GLSLANG_CLIENT_COUNT), | ||
| } glslang_client_t; | ||
|
|
||
| /* EShTargetLanguage counterpart */ | ||
| typedef enum { | ||
| GLSLANG_TARGET_NONE, | ||
| GLSLANG_TARGET_SPV, | ||
| LAST_ELEMENT_MARKER(GLSLANG_TARGET_COUNT), | ||
| } glslang_target_language_t; | ||
|
|
||
| /* SH_TARGET_ClientVersion counterpart */ | ||
| typedef enum { | ||
| GLSLANG_TARGET_VULKAN_1_0 = (1 << 22), | ||
| GLSLANG_TARGET_VULKAN_1_1 = (1 << 22) | (1 << 12), | ||
| GLSLANG_TARGET_VULKAN_1_2 = (1 << 22) | (2 << 12), | ||
| GLSLANG_TARGET_VULKAN_1_3 = (1 << 22) | (3 << 12), | ||
| GLSLANG_TARGET_OPENGL_450 = 450, | ||
| LAST_ELEMENT_MARKER(GLSLANG_TARGET_CLIENT_VERSION_COUNT = 5), | ||
| } glslang_target_client_version_t; | ||
|
|
||
| /* SH_TARGET_LanguageVersion counterpart */ | ||
| typedef enum { | ||
| GLSLANG_TARGET_SPV_1_0 = (1 << 16), | ||
| GLSLANG_TARGET_SPV_1_1 = (1 << 16) | (1 << 8), | ||
| GLSLANG_TARGET_SPV_1_2 = (1 << 16) | (2 << 8), | ||
| GLSLANG_TARGET_SPV_1_3 = (1 << 16) | (3 << 8), | ||
| GLSLANG_TARGET_SPV_1_4 = (1 << 16) | (4 << 8), | ||
| GLSLANG_TARGET_SPV_1_5 = (1 << 16) | (5 << 8), | ||
| GLSLANG_TARGET_SPV_1_6 = (1 << 16) | (6 << 8), | ||
| LAST_ELEMENT_MARKER(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT = 7), | ||
| } glslang_target_language_version_t; | ||
|
|
||
| /* EShExecutable counterpart */ | ||
| typedef enum { GLSLANG_EX_VERTEX_FRAGMENT, GLSLANG_EX_FRAGMENT } glslang_executable_t; | ||
|
|
||
| // EShOptimizationLevel counterpart | ||
| // This enum is not used in the current C interface, but could be added at a later date. | ||
| // GLSLANG_OPT_NONE is the current default. | ||
| typedef enum { | ||
| GLSLANG_OPT_NO_GENERATION, | ||
| GLSLANG_OPT_NONE, | ||
| GLSLANG_OPT_SIMPLE, | ||
| GLSLANG_OPT_FULL, | ||
| LAST_ELEMENT_MARKER(GLSLANG_OPT_LEVEL_COUNT), | ||
| } glslang_optimization_level_t; | ||
|
|
||
| /* EShTextureSamplerTransformMode counterpart */ | ||
| typedef enum { | ||
| GLSLANG_TEX_SAMP_TRANS_KEEP, | ||
| GLSLANG_TEX_SAMP_TRANS_UPGRADE_TEXTURE_REMOVE_SAMPLER, | ||
| LAST_ELEMENT_MARKER(GLSLANG_TEX_SAMP_TRANS_COUNT), | ||
| } glslang_texture_sampler_transform_mode_t; | ||
|
|
||
| /* EShMessages counterpart */ | ||
| typedef enum { | ||
| GLSLANG_MSG_DEFAULT_BIT = 0, | ||
| GLSLANG_MSG_RELAXED_ERRORS_BIT = (1 << 0), | ||
| GLSLANG_MSG_SUPPRESS_WARNINGS_BIT = (1 << 1), | ||
| GLSLANG_MSG_AST_BIT = (1 << 2), | ||
| GLSLANG_MSG_SPV_RULES_BIT = (1 << 3), | ||
| GLSLANG_MSG_VULKAN_RULES_BIT = (1 << 4), | ||
| GLSLANG_MSG_ONLY_PREPROCESSOR_BIT = (1 << 5), | ||
| GLSLANG_MSG_READ_HLSL_BIT = (1 << 6), | ||
| GLSLANG_MSG_CASCADING_ERRORS_BIT = (1 << 7), | ||
| GLSLANG_MSG_KEEP_UNCALLED_BIT = (1 << 8), | ||
| GLSLANG_MSG_HLSL_OFFSETS_BIT = (1 << 9), | ||
| GLSLANG_MSG_DEBUG_INFO_BIT = (1 << 10), | ||
| GLSLANG_MSG_HLSL_ENABLE_16BIT_TYPES_BIT = (1 << 11), | ||
| GLSLANG_MSG_HLSL_LEGALIZATION_BIT = (1 << 12), | ||
| GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT = (1 << 13), | ||
| GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT = (1 << 14), | ||
| GLSLANG_MSG_ENHANCED = (1 << 15), | ||
| LAST_ELEMENT_MARKER(GLSLANG_MSG_COUNT), | ||
| } glslang_messages_t; | ||
|
|
||
| /* EShReflectionOptions counterpart */ | ||
| typedef enum { | ||
| GLSLANG_REFLECTION_DEFAULT_BIT = 0, | ||
| GLSLANG_REFLECTION_STRICT_ARRAY_SUFFIX_BIT = (1 << 0), | ||
| GLSLANG_REFLECTION_BASIC_ARRAY_SUFFIX_BIT = (1 << 1), | ||
| GLSLANG_REFLECTION_INTERMEDIATE_IOO_BIT = (1 << 2), | ||
| GLSLANG_REFLECTION_SEPARATE_BUFFERS_BIT = (1 << 3), | ||
| GLSLANG_REFLECTION_ALL_BLOCK_VARIABLES_BIT = (1 << 4), | ||
| GLSLANG_REFLECTION_UNWRAP_IO_BLOCKS_BIT = (1 << 5), | ||
| GLSLANG_REFLECTION_ALL_IO_VARIABLES_BIT = (1 << 6), | ||
| GLSLANG_REFLECTION_SHARED_STD140_SSBO_BIT = (1 << 7), | ||
| GLSLANG_REFLECTION_SHARED_STD140_UBO_BIT = (1 << 8), | ||
| LAST_ELEMENT_MARKER(GLSLANG_REFLECTION_COUNT), | ||
| } glslang_reflection_options_t; | ||
|
|
||
| /* EProfile counterpart (from Versions.h) */ | ||
| typedef enum { | ||
| GLSLANG_BAD_PROFILE = 0, | ||
| GLSLANG_NO_PROFILE = (1 << 0), | ||
| GLSLANG_CORE_PROFILE = (1 << 1), | ||
| GLSLANG_COMPATIBILITY_PROFILE = (1 << 2), | ||
| GLSLANG_ES_PROFILE = (1 << 3), | ||
| LAST_ELEMENT_MARKER(GLSLANG_PROFILE_COUNT), | ||
| } glslang_profile_t; | ||
|
|
||
| /* Shader options */ | ||
| typedef enum { | ||
| GLSLANG_SHADER_DEFAULT_BIT = 0, | ||
| GLSLANG_SHADER_AUTO_MAP_BINDINGS = (1 << 0), | ||
| GLSLANG_SHADER_AUTO_MAP_LOCATIONS = (1 << 1), | ||
| GLSLANG_SHADER_VULKAN_RULES_RELAXED = (1 << 2), | ||
| LAST_ELEMENT_MARKER(GLSLANG_SHADER_COUNT), | ||
| } glslang_shader_options_t; | ||
|
|
||
| /* TResourceType counterpart */ | ||
| typedef enum { | ||
| GLSLANG_RESOURCE_TYPE_SAMPLER, | ||
| GLSLANG_RESOURCE_TYPE_TEXTURE, | ||
| GLSLANG_RESOURCE_TYPE_IMAGE, | ||
| GLSLANG_RESOURCE_TYPE_UBO, | ||
| GLSLANG_RESOURCE_TYPE_SSBO, | ||
| GLSLANG_RESOURCE_TYPE_UAV, | ||
| LAST_ELEMENT_MARKER(GLSLANG_RESOURCE_TYPE_COUNT), | ||
| } glslang_resource_type_t; | ||
|
|
||
| #undef LAST_ELEMENT_MARKER | ||
|
|
||
| #endif |