It also removes some old code that ancient compilers used to need.
However, the main issue is getting access to hash functions for
unordered_map in portable way.
This simplification is a prelude to eliminating what I appear unnecessary
symbol inserts into tables when tokenizing in the preprecessor, which
show up as taking notable time. (Performance issue.) It also simply makes
the preprocessor easier to understand, which it is badly in need of.
TInputScanner advances its internal indices to the next character at
the end of get(), which means, after reading in the last character
in the user-provided shader string, internal index (currentSource)
will point to the next shader string (currentSource == numSources),
which doesn't exist. Then if a location setting method is called,
we will write to some out-of-bound memory.
A test case for this is "#line 10000\n". The eval() method in CPPline()
will evaluate 10000, but at the same time it reads in the next
token, '\n', and the currentSource will be numSources in TInputScanner.
Then a parseContext.setCurrentLine() is called, we are writing to
out-of-bound memory. Another test case will be "#line 10000 0\n".
Added error output to the preprocessor.
This patch distinguishes preprocessing errors with normal parsing
errors and gives glslangValidator the ability to output preprocessing
errors.
The current line number for the #line directive should be passed
in as parameter to the line directive callback. Without it, we
don't know how many empty lines we should output.
The line argument passed into the lineCallback function is the
literal value of the first argument of the #line directive.
lastLine in DoPreprocessing() should be updated taking into
consideration the different definitions for #line between specs.
Add a test to reveal the bug.
Simplify function calls for extensionsTurnedOn().
Lots of places in the code use extensionsTurnedOn(1, ...). This
patch introduces a new method, extensionTurnedOn(), for testing
if a single extension is turned on.
Lots of places in the code use extensionsTurnedOn(1, ...). This
patch introduces a new method, extensionTurnedOn(), for testing
if a single extension is turned on.
The infrastructure is in place to not do text comparisons for "texture" ... for deducing type of
texture call. But, it is not yet turned on, as it could break some consumers. Am soliciting
any feedback on that.
See in Initialize.cpp: const bool PureOperatorBuiltins = false; // could break backward compatibility; pending feedback
- member initializing order in some constructors
- missing default branches in switch-case
- uninitialized variable if switch-case default (uncritical because
program would exit)
- && and || brace warnings in if()
New extensions in glext.h follow the pattern:
#ifndef GL_ARB_texture_rectangle
#define GL_ARB_texture_rectangle 1
#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
#endif /* GL_ARB_texture_rectangle */
Versions.h tries to declare:
const char* const GL_ARB_texture_rectangle = "GL_ARB_texture_rectangle";
Which means, if you've included glext.h before Versions.h, that the
compiler will see "const char* const 1 = ...", and rightly refuse to
continue.
The ham-fisted approach taken here is to rename the variables in
Versions.h with a leading underscore. This does sort of undermine the
comment about "better to have the compiler do spelling checks", but.
Signed-off-by: Adam Jackson <ajax@redhat.com>