Add more builder functions to OpExecutionMode, OpExecutionModeId,
OpDecorateString, OpMemberDecorateString.
According to SPIR-V, OpExecutionMode and OpExecutionModeId could
take variable extra operands. Current implementation doesn't support
this and assumes at most 3 operands are extra operands. It is not
true. Similarly, OpDecorateString and OpMemberDecorateString could
support multiple strings either as literal strings or as string
operands. Further, OpDecorate and OpDecorateId have the same problem,
taking variable extra operands.
* 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.
According to the extension SPV_GOOGLE_decorate_string,
OpDecorateString (or OpMemberDecorateString) ought to be capable of
supporting multiple literal strings. Each literal strings are padded
with null terminator to make word alignment. The layout is:
Inst | Target | Decoration | Literal String, Literal String, ...
* Remove image2DShadow and other 3 tokens. Refine codes.
Remove image2DShadow and other 3 tokens. Refine codes.
* 110scope.vert has redefinition part of what's removed from 100scope.vert
The current implementation makes tests fail when it is imported from a
different Bazel workspace. We fix that by using
the --test-root flag to pass the rootpath to the
tests.
We need separate concepts for
- total set of extensions ever enabled, for the back end
- current state of extensions, for parsing
- the set of features currently enabled for building the AST
This detangles incorrect conflation of HLSL with GLSL extensions,
defers asking expensive questions until it's time to ask, and removes
some dead code.
The scalar type was already the basic type passed in.
Also factored out of this the checking of extensions for 8/16-bit stuff.
This code seems wrong in several ways, but for now just documenting it.
This change strips a few features similar to GLSLANG_WEB but doesn't
remove every detail like the latter. It also hardcodes profile/version
to core/450.
In particular, TBuiltIns::initialize is specialized to remove most of
what is not supported or won't be supported by ANGLE. The result of
this function is parsed with TParseContext::parseShaderStrings which is
a performance bottleneck.
This change shaves about 300KB off of ANGLE's binary size and reduces
the cost of SetupBuiltinSymbolTable to nearly a sixth.
Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
iOS 8 does not support `thread_local`, which is still in use.
Another approach will have to be found.
This change is a revert of the following changes:
a3845240 - "Simplify PoolAlloc with use of thread_local."
abf92c80 - "Deprecate InitializeDll functions"
33585c87 - "Limit visibility of symbols for internal libraries"
Issue: #2346