glslang-zig/glslang/MachineIndependent
Chow 9eaa69c21c
Preprocessor related issue fix (#2378)
* Preprocessor related fix

1). Accoding to ESSL spec : All macro names containing two consecutive underscores ( __ ) are reserved for future use as predefined macro names, so just report a warning instead of error when the shader defines the macro names begining with  '__';

2. According to spec:  If an implementation does not recognize the tokens following #pragma, then it will ignore that pragma, so report a compile-time warning intead of error for the following statement:
#pragma debug(1.23)

3. The 'defined' macro should be allowed to expand and '__LINE__' should be allowed to be replaced with its original line number (otherwise, other expanding macros may change this value).

4. Add a flag 'indentifierSeen' in PPContext to indicate whether the any non-preprocessor tokens is existed before the extension directives, because the built-in symbols and functions are parsed before paring the user shader, so add a 'shaderSource' flag to check this error only for the user shader source;

5. Add missing type int16 and uint16.

* Add test results, remove restriction of #extension.

1. Remove extension restriction in first line , as this is contraversy now.

2. The following shader is compiled failed as glslang consider the keyword 'defined' can not be undefined(in the 9th line: "#define defined BBB")
The shader is as following:
According to ES3.0 spec: It is an error to undefine or to redefine a built-in (pre-defined) macro name.
This rule is aimed to the  __LINE__,  __FILE__, __VERSION__ and  GL_ES,
the keyword "defined" should not be restricted by this rule,
so change the compile error to warning and make the following shader compile successfully.

* 1. Using relaxedError to control error/warning report level. 2. remove #extension restriction. 3. Fix version related issue.

1. Using relaxedError to control error/warning report level. 2. remove #extension restriction. 3. Fix version related issue.

* Add test results

* Turn conditional warnings about pragma to unconditional ones.
2020-09-14 21:46:24 -06:00
..
preprocessor Preprocessor related issue fix (#2378) 2020-09-14 21:46:24 -06:00
attribute.cpp Web: Turn off bracket-style attributes, reflection, and IO mapping. 2019-08-20 23:21:55 -06:00
attribute.h HLSL: Fix #1912: add attribute syntax for nonreadable/nonwritable 2019-09-29 19:16:25 -06:00
Constant.cpp Copyright update, mostly to trigger bots again. 2020-03-01 04:51:40 -07:00
gl_types.h Preprocessor related issue fix (#2378) 2020-09-14 21:46:24 -06:00
glslang.m4 Fix scope definition in ES 100. (#2379) 2020-09-14 08:00:48 -06:00
glslang.y Fix scope definition in ES 100. (#2379) 2020-09-14 08:00:48 -06:00
glslang_tab.cpp Fix scope definition in ES 100. (#2379) 2020-09-14 08:00:48 -06:00
glslang_tab.cpp.h Non-functional: correctly do GL_EXT_buffer_reference2 semantic checking 2020-08-07 02:26:04 -06:00
InfoSink.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
Initialize.cpp Allow subpassLoad for ANGLE 2020-09-11 22:30:49 -04:00
Initialize.h Comment out params instead of removing 2019-09-11 08:59:47 -04:00
Intermediate.cpp Build: fix a build warning 2020-08-14 19:39:28 -06:00
intermOut.cpp Fix #2366, fix #2358, correctly separate out numerical feature checking 2020-08-14 08:40:06 -06:00
IntermTraverse.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
iomapper.cpp Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
iomapper.h Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
limits.cpp Web: Turn off includes, independent preprocessing path, fine tune all. 2019-08-20 23:21:56 -06:00
linkValidate.cpp Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
LiveTraverser.h also search global variables assignment for live variables 2020-07-20 18:43:00 -04:00
localintermediate.h Fix #2366, fix #2358, correctly separate out numerical feature checking 2020-08-14 08:40:06 -06:00
parseConst.cpp Fix MSVC build issue - remove invalid character 2020-03-19 15:31:31 -06:00
ParseContextBase.cpp Error assigns to objects of rayQueryEXT type. 2020-03-30 10:24:30 -07:00
ParseHelper.cpp Preprocessor related issue fix (#2378) 2020-09-14 21:46:24 -06:00
ParseHelper.h Fix scope definition in ES 100. (#2379) 2020-09-14 08:00:48 -06:00
parseVersions.h Fix #2366, fix #2358, correctly separate out numerical feature checking 2020-08-14 08:40:06 -06:00
pch.h Use precompiled headers for some glslang projects 2018-10-31 15:38:08 -05:00
PoolAlloc.cpp Revert changes that migrate to thread_local. 2020-07-31 07:13:24 +01:00
propagateNoContraction.cpp Make file formatting comply with POSIX and Unix standards 2020-03-21 03:20:25 -04:00
propagateNoContraction.h [lumped builds] Add include guards (#pragma once) to header files that did not have any. 2017-05-10 16:58:38 +03:00
reflection.cpp Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
reflection.h Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
RemoveTree.cpp Non-functional: White space after "//", mostly for copyrights. 2017-01-06 12:34:14 -07:00
RemoveTree.h [lumped builds] Add include guards (#pragma once) to header files that did not have any. 2017-05-10 16:58:38 +03:00
Scan.cpp Revert "Merge pull request #2330 from ShabbyX/optimize_for_angle" 2020-07-13 03:39:08 -06:00
Scan.h SPV: Fix #1575, fix #1593: Support HLSL #line 2018-12-07 17:36:33 -07:00
ScanContext.h GL_EXT_buffer_reference 2019-01-07 12:36:13 -06:00
ShaderLang.cpp Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
SymbolTable.cpp Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
SymbolTable.h Use GLSLANG_ANGLE to strip features to what ANGLE requires 2020-07-31 12:44:49 -04:00
Versions.cpp Parser: Fix wrong names of extension macros 2020-09-02 23:03:03 +08:00
Versions.h Add changes for SPV_EXT_shader_atomic_float_add 2020-07-22 05:52:22 -07:00