glslang: Add API override of version and profile for testing purposes. From Lei Zhang <antiagainst@google.com>.

Add defaultProfile and forceDefaultVersionAndProfile into shader
compilation interface.

forceDefaultVersionAndProfile allows us to force parsing the input
shaders using defaultVersion and defaultProfile, regardless of
the #version directive in input shaders.

These two parameters enables us to programmatically invoke glslang
but specify version and profile from somewhere else like command
line.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31504 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2015-06-16 19:01:56 +00:00
parent 99a3c59fae
commit edadf45605
5 changed files with 48 additions and 18 deletions

View file

@ -35,6 +35,7 @@
#define _COMPILER_INTERFACE_INCLUDED_
#include "../Include/ResourceLimits.h"
#include "../MachineIndependent/Versions.h"
#ifdef _WIN32
#define C_DECL __cdecl
@ -279,6 +280,9 @@ public:
virtual ~TShader();
void setStrings(const char* const* s, int n) { strings = s; numStrings = n; }
void setPreamble(const char* s) { preamble = s; }
bool parse(const TBuiltInResource*, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, bool forwardCompatible, EShMessages);
// Equivalent to parse() without a default profile and without forcing defaults.
// Provided for backwards compatibility.
bool parse(const TBuiltInResource*, int defaultVersion, bool forwardCompatible, EShMessages);
const char* getInfoLog();