Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
ca593a98
Commit
ca593a98
authored
Dec 25, 2019
by
Sergey Kosarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CInterface: reformatted according to .clang-format rules
parent
8cded6cc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
109 deletions
+91
-109
glslang_c_interface.cpp
glslang/CInterface/glslang_c_interface.cpp
+0
-0
c_shader_types.h
glslang/Include/c_shader_types.h
+41
-46
glslang_c_interface.h
glslang/Include/glslang_c_interface.h
+50
-63
No files found.
glslang/CInterface/glslang_c_interface.cpp
View file @
ca593a98
This diff is collapsed.
Click to expand it.
glslang/Include/c_shader_types.h
View file @
ca593a98
...
@@ -46,24 +46,24 @@ typedef enum {
...
@@ -46,24 +46,24 @@ typedef enum {
SH_STAGE_TASK_NV
,
SH_STAGE_TASK_NV
,
SH_STAGE_MESH_NV
,
SH_STAGE_MESH_NV
,
SH_STAGE_COUNT
,
SH_STAGE_COUNT
,
}
glslang_stage_t
;
// would be better as stage, but this is ancient now
}
glslang_stage_t
;
// would be better as stage, but this is ancient now
/* EShLanguageMask counterpart */
/* EShLanguageMask counterpart */
typedef
enum
{
typedef
enum
{
SH_STAGE_VERTEX_MASK
=
(
1
<<
SH_STAGE_VERTEX
),
SH_STAGE_VERTEX_MASK
=
(
1
<<
SH_STAGE_VERTEX
),
SH_STAGE_TESSCONTROL_MASK
=
(
1
<<
SH_STAGE_TESSCONTROL
),
SH_STAGE_TESSCONTROL_MASK
=
(
1
<<
SH_STAGE_TESSCONTROL
),
SH_STAGE_TESSEVALUATION_MASK
=
(
1
<<
SH_STAGE_TESSEVALUATION
),
SH_STAGE_TESSEVALUATION_MASK
=
(
1
<<
SH_STAGE_TESSEVALUATION
),
SH_STAGE_GEOMETRY_MASK
=
(
1
<<
SH_STAGE_GEOMETRY
),
SH_STAGE_GEOMETRY_MASK
=
(
1
<<
SH_STAGE_GEOMETRY
),
SH_STAGE_FRAGMENT_MASK
=
(
1
<<
SH_STAGE_FRAGMENT
),
SH_STAGE_FRAGMENT_MASK
=
(
1
<<
SH_STAGE_FRAGMENT
),
SH_STAGE_COMPUTE_MASK
=
(
1
<<
SH_STAGE_COMPUTE
),
SH_STAGE_COMPUTE_MASK
=
(
1
<<
SH_STAGE_COMPUTE
),
SH_STAGE_RAYGEN_NV_MASK
=
(
1
<<
SH_STAGE_RAYGEN_NV
),
SH_STAGE_RAYGEN_NV_MASK
=
(
1
<<
SH_STAGE_RAYGEN_NV
),
SH_STAGE_INTERSECT_NV_MASK
=
(
1
<<
SH_STAGE_INTERSECT_NV
),
SH_STAGE_INTERSECT_NV_MASK
=
(
1
<<
SH_STAGE_INTERSECT_NV
),
SH_STAGE_ANYHIT_NV_MASK
=
(
1
<<
SH_STAGE_ANYHIT_NV
),
SH_STAGE_ANYHIT_NV_MASK
=
(
1
<<
SH_STAGE_ANYHIT_NV
),
SH_STAGE_CLOSESTHIT_NV_MASK
=
(
1
<<
SH_STAGE_CLOSESTHIT_NV
),
SH_STAGE_CLOSESTHIT_NV_MASK
=
(
1
<<
SH_STAGE_CLOSESTHIT_NV
),
SH_STAGE_MISS_NV_MASK
=
(
1
<<
SH_STAGE_MISS_NV
),
SH_STAGE_MISS_NV_MASK
=
(
1
<<
SH_STAGE_MISS_NV
),
SH_STAGE_CALLABLE_NV_MASK
=
(
1
<<
SH_STAGE_CALLABLE_NV
),
SH_STAGE_CALLABLE_NV_MASK
=
(
1
<<
SH_STAGE_CALLABLE_NV
),
SH_STAGE_TASK_NV_MASK
=
(
1
<<
SH_STAGE_TASK_NV
),
SH_STAGE_TASK_NV_MASK
=
(
1
<<
SH_STAGE_TASK_NV
),
SH_STAGE_MESH_NV_MASK
=
(
1
<<
SH_STAGE_MESH_NV
),
SH_STAGE_MESH_NV_MASK
=
(
1
<<
SH_STAGE_MESH_NV
),
}
glslang_stage_mask_t
;
}
glslang_stage_mask_t
;
/* EShSource counterpart */
/* EShSource counterpart */
...
@@ -104,10 +104,7 @@ typedef enum {
...
@@ -104,10 +104,7 @@ typedef enum {
}
glslang_target_language_version_t
;
}
glslang_target_language_version_t
;
/* EShExecutable counterpart */
/* EShExecutable counterpart */
typedef
enum
{
typedef
enum
{
SH_EX_VERTEX_FRAGMENT
,
SH_EX_FRAGMENT
}
glslang_executable_t
;
SH_EX_VERTEX_FRAGMENT
,
SH_EX_FRAGMENT
}
glslang_executable_t
;
/* EShOptimizationLevel counterpart */
/* EShOptimizationLevel counterpart */
typedef
enum
{
typedef
enum
{
...
@@ -125,44 +122,42 @@ typedef enum {
...
@@ -125,44 +122,42 @@ typedef enum {
/* EShMessages counterpart */
/* EShMessages counterpart */
typedef
enum
{
typedef
enum
{
SH_MSG_DEFAULT
=
0
,
SH_MSG_DEFAULT
=
0
,
SH_MSG_RELAXED_ERRORS
=
(
1
<<
0
),
SH_MSG_RELAXED_ERRORS
=
(
1
<<
0
),
SH_MSG_SUPPRESS_WARNINGS
=
(
1
<<
1
),
SH_MSG_SUPPRESS_WARNINGS
=
(
1
<<
1
),
SH_MSG_AST
=
(
1
<<
2
),
SH_MSG_AST
=
(
1
<<
2
),
SH_MSG_SPV_RULES
=
(
1
<<
3
),
SH_MSG_SPV_RULES
=
(
1
<<
3
),
SH_MSG_VULKAN_RULES
=
(
1
<<
4
),
SH_MSG_VULKAN_RULES
=
(
1
<<
4
),
SH_MSG_ONLY_PREPROCESSOR
=
(
1
<<
5
),
SH_MSG_ONLY_PREPROCESSOR
=
(
1
<<
5
),
SH_MSG_READ_HLSL
=
(
1
<<
6
),
SH_MSG_READ_HLSL
=
(
1
<<
6
),
SH_MSG_CASCADING_ERRORS
=
(
1
<<
7
),
SH_MSG_CASCADING_ERRORS
=
(
1
<<
7
),
SH_MSG_KEEP_UNCALLED
=
(
1
<<
8
),
SH_MSG_KEEP_UNCALLED
=
(
1
<<
8
),
SH_MSG_HLSL_OFFSETS
=
(
1
<<
9
),
SH_MSG_HLSL_OFFSETS
=
(
1
<<
9
),
SH_MSG_DEBUG_INFO
=
(
1
<<
10
),
SH_MSG_DEBUG_INFO
=
(
1
<<
10
),
SH_MSG_HLSL_ENABLE_16BIT_TYPES
=
(
1
<<
11
),
SH_MSG_HLSL_ENABLE_16BIT_TYPES
=
(
1
<<
11
),
SH_MSG_HLSL_LEGALIZATION
=
(
1
<<
12
),
SH_MSG_HLSL_LEGALIZATION
=
(
1
<<
12
),
SH_MSG_HLSL_DX9_COMPATIBLE
=
(
1
<<
13
),
SH_MSG_HLSL_DX9_COMPATIBLE
=
(
1
<<
13
),
SH_MSG_BUILTIN_SYMBOL_TABLE
=
(
1
<<
14
),
SH_MSG_BUILTIN_SYMBOL_TABLE
=
(
1
<<
14
),
}
glslang_messages_t
;
}
glslang_messages_t
;
/* EShReflectionOptions counterpart */
/* EShReflectionOptions counterpart */
typedef
enum
typedef
enum
{
{
SH_REFLECTION_DEFAULT
=
0
,
SH_REFLECTION_DEFAULT
=
0
,
SH_REFLECTION_STRICT_ARRAY_SUFFIX
=
(
1
<<
0
),
SH_REFLECTION_STRICT_ARRAY_SUFFIX
=
(
1
<<
0
),
SH_REFLECTION_BASIC_ARRAY_SUFFIX
=
(
1
<<
1
),
SH_REFLECTION_BASIC_ARRAY_SUFFIX
=
(
1
<<
1
),
SH_REFLECTION_INTERMEDIATE_IOO
=
(
1
<<
2
),
SH_REFLECTION_INTERMEDIATE_IOO
=
(
1
<<
2
),
SH_REFLECTION_SEPARATE_BUFFERS
=
(
1
<<
3
),
SH_REFLECTION_SEPARATE_BUFFERS
=
(
1
<<
3
),
SH_REFLECTION_ALL_BLOCK_VARIABLES
=
(
1
<<
4
),
SH_REFLECTION_ALL_BLOCK_VARIABLES
=
(
1
<<
4
),
SH_REFLECTION_UNWRAP_IO_BLOCKS
=
(
1
<<
5
),
SH_REFLECTION_UNWRAP_IO_BLOCKS
=
(
1
<<
5
),
}
glslang_reflection_options_t
;
}
glslang_reflection_options_t
;
/* EProfile counterpart (from Versions.h) */
/* EProfile counterpart (from Versions.h) */
typedef
enum
{
typedef
enum
{
SH_BAD_PROFILE
=
0
,
SH_BAD_PROFILE
=
0
,
SH_NO_PROFILE
=
(
1
<<
0
),
SH_NO_PROFILE
=
(
1
<<
0
),
SH_CORE_PROFILE
=
(
1
<<
1
),
SH_CORE_PROFILE
=
(
1
<<
1
),
SH_COMPATIBILITY_PROFILE
=
(
1
<<
2
),
SH_COMPATIBILITY_PROFILE
=
(
1
<<
2
),
SH_ES_PROFILE
=
(
1
<<
3
)
SH_ES_PROFILE
=
(
1
<<
3
)
}
glslang_profile_t
;
}
glslang_profile_t
;
#endif
#endif
glslang/Include/glslang_c_interface.h
View file @
ca593a98
...
@@ -36,92 +36,79 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
...
@@ -36,92 +36,79 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
typedef
struct
glslang_shader_s
glslang_shader_t
;
typedef
struct
glslang_shader_s
glslang_shader_t
;
typedef
struct
glslang_program_s
glslang_program_t
;
typedef
struct
glslang_program_s
glslang_program_t
;
typedef
struct
glslang_input_s
typedef
struct
glslang_input_s
{
{
glslang_source_t
language
;
glslang_source_t
language
;
glslang_stage_t
stage
;
glslang_stage_t
stage
;
glslang_client_t
client
;
glslang_client_t
client
;
glslang_target_client_version_t
client_version
;
glslang_target_client_version_t
client_version
;
glslang_target_language_t
target_language
;
glslang_target_language_t
target_language
;
glslang_target_language_version_t
target_language_version
;
glslang_target_language_version_t
target_language_version
;
/** Shader source code */
/** Shader source code */
const
char
*
code
;
const
char
*
code
;
int
default_version
;
int
default_version
;
glslang_profile_t
default_profile
;
glslang_profile_t
default_profile
;
int
force_default_version_and_profile
;
int
force_default_version_and_profile
;
int
forward_compatible
;
int
forward_compatible
;
glslang_messages_t
messages
;
glslang_messages_t
messages
;
}
glslang_input_t
;
}
glslang_input_t
;
/* Inclusion result structure allocated by C include_local/include_system callbacks */
/* Inclusion result structure allocated by C include_local/include_system callbacks */
typedef
struct
glsl_include_result_s
typedef
struct
glsl_include_result_s
{
{
/* Header file name or NULL if inclusion failed */
/* Header file name or NULL if inclusion failed */
const
char
*
header_name
;
const
char
*
header_name
;
/* Header contents or NULL */
/* Header contents or NULL */
const
char
*
header_data
;
const
char
*
header_data
;
size_t
header_length
;
size_t
header_length
;
}
glsl_include_result_t
;
}
glsl_include_result_t
;
/* Callback for local file inclusion */
/* Callback for local file inclusion */
typedef
glsl_include_result_t
*
(
*
glsl_include_local_func
)(
typedef
glsl_include_result_t
*
(
*
glsl_include_local_func
)(
void
*
ctx
,
const
char
*
header_name
,
const
char
*
includer_name
,
void
*
ctx
,
size_t
include_depth
);
const
char
*
header_name
,
const
char
*
includer_name
,
size_t
include_depth
);
/* Callback for system file inclusion */
/* Callback for system file inclusion */
typedef
glsl_include_result_t
*
(
*
glsl_include_system_func
)(
typedef
glsl_include_result_t
*
(
*
glsl_include_system_func
)(
void
*
ctx
,
const
char
*
header_name
,
void
*
ctx
,
const
char
*
includer_name
,
size_t
include_depth
);
const
char
*
header_name
,
const
char
*
includer_name
,
size_t
include_depth
);
/* Callback for include result destruction */
/* Callback for include result destruction */
typedef
int
(
*
glsl_free_include_result_func
)(
typedef
int
(
*
glsl_free_include_result_func
)(
void
*
ctx
,
glsl_include_result_t
*
result
);
void
*
ctx
,
glsl_include_result_t
*
result
);
/* Collection of callbacks for GLSL preprocessor */
/* Collection of callbacks for GLSL preprocessor */
typedef
struct
glsl_include_callbacks_s
typedef
struct
glsl_include_callbacks_s
{
{
glsl_include_system_func
include_system
;
glsl_include_system_func
include_system
;
glsl_include_local_func
include_local
;
glsl_include_local_func
include_local
;
glsl_free_include_result_func
free_include_result
;
glsl_free_include_result_func
free_include_result
;
}
glsl_include_callbacks_t
;
}
glsl_include_callbacks_t
;
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
extern
"C"
{
{
#endif
#endif
int
glslang_initialize_process
();
int
glslang_initialize_process
();
void
glslang_finalize_process
();
void
glslang_finalize_process
();
glslang_shader_t
*
glslang_shader_create
(
glslang_input_t
*
input
);
glslang_shader_t
*
glslang_shader_create
(
glslang_input_t
*
input
);
void
glslang_shader_delete
(
glslang_shader_t
*
shader
);
void
glslang_shader_delete
(
glslang_shader_t
*
shader
);
int
glslang_shader_preprocess
(
glslang_shader_t
*
shader
,
glslang_input_t
*
input
);
int
glslang_shader_preprocess
(
glslang_shader_t
*
shader
,
glslang_input_t
*
input
);
int
glslang_shader_parse
(
glslang_shader_t
*
shader
,
glslang_input_t
*
input
);
int
glslang_shader_parse
(
glslang_shader_t
*
shader
,
glslang_input_t
*
input
);
const
char
*
glslang_shader_get_preprocessed_code
(
glslang_shader_t
*
shader
);
const
char
*
glslang_shader_get_preprocessed_code
(
glslang_shader_t
*
shader
);
const
char
*
glslang_shader_get_info_log
(
glslang_shader_t
*
shader
);
const
char
*
glslang_shader_get_info_log
(
glslang_shader_t
*
shader
);
const
char
*
glslang_shader_get_info_debug_log
(
glslang_shader_t
*
shader
);
const
char
*
glslang_shader_get_info_debug_log
(
glslang_shader_t
*
shader
);
glslang_program_t
*
glslang_program_create
();
glslang_program_t
*
glslang_program_create
();
void
glslang_program_delete
(
glslang_program_t
*
program
);
void
glslang_program_delete
(
glslang_program_t
*
program
);
void
glslang_program_add_shader
(
glslang_program_t
*
program
,
glslang_shader_t
*
shader
);
void
glslang_program_add_shader
(
glslang_program_t
*
program
,
glslang_shader_t
*
shader
);
int
glslang_program_link
(
glslang_program_t
*
program
,
int
messages
);
int
glslang_program_link
(
glslang_program_t
*
program
,
int
messages
);
void
glslang_program_SPIRV_generate
(
glslang_program_t
*
program
,
glslang_stage_t
stage
);
void
glslang_program_SPIRV_generate
(
glslang_program_t
*
program
,
glslang_stage_t
stage
);
size_t
glslang_program_SPIRV_get_size
(
glslang_program_t
*
program
);
size_t
glslang_program_SPIRV_get_size
(
glslang_program_t
*
program
);
void
glslang_program_SPIRV_get
(
glslang_program_t
*
program
,
unsigned
int
*
);
void
glslang_program_SPIRV_get
(
glslang_program_t
*
program
,
unsigned
int
*
);
const
char
*
glslang_program_SPIRV_get_messages
(
glslang_program_t
*
program
);
const
char
*
glslang_program_SPIRV_get_messages
(
glslang_program_t
*
program
);
const
char
*
glslang_program_get_info_log
(
glslang_program_t
*
program
);
const
char
*
glslang_program_get_info_log
(
glslang_program_t
*
program
);
const
char
*
glslang_program_get_info_debug_log
(
glslang_program_t
*
program
);
const
char
*
glslang_program_get_info_debug_log
(
glslang_program_t
*
program
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
#endif
/* #ifdef GLSLANG_C_IFACE_INCLUDED */
#endif
/* #ifdef GLSLANG_C_IFACE_INCLUDED */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment