Use ShaderVars instead of ShaderLang in headers.

We only need the typed variable information in our header files.
The entry point and other enum info can be encapsulated better
in the cpp files that call through to the translator. The only
tricky one is the compile options, which we return from our
implementation - put the typedef for these in the ShaderVars
header to fix this.

This should partially work around the problem of shaderlang
for Vulkan and ANGLE's translator (also ShaderLang) using some
identifiers with the same names.

BUG=angleproject:1576

Change-Id: I43c530486498c210796b9e197a6780bf2f7b3afb
Reviewed-on: https://chromium-review.googlesource.com/412423
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Jamie Madill 2016-11-17 16:40:22 -05:00 коммит произвёл Commit Bot
Родитель 99bd5f40f3
Коммит 861ebb3bb8
3 изменённых файлов: 9 добавлений и 13 удалений

Просмотреть файл

@ -20,19 +20,12 @@
// and the shading language compiler.
//
namespace sh
{
// GLenum alias
typedef unsigned int GLenum;
}
// Must be included after GLenum proxy typedef
// Note: make sure to increment ANGLE_SH_VERSION when changing ShaderVars.h
#include "ShaderVars.h"
// Version number for shader translation API.
// It is incremented every time the API changes.
#define ANGLE_SH_VERSION 167
#define ANGLE_SH_VERSION 168
enum ShShaderSpec
{
@ -72,8 +65,8 @@ enum ShShaderOutput
};
// Compile options.
using ShCompileOptions = uint64_t;
// The Compile options type is defined in ShaderVars.h, to allow ANGLE to import the ShaderVars
// header without needing the ShaderLang header. This avoids some conflicts with glslang.
const ShCompileOptions SH_VALIDATE = 0;
const ShCompileOptions SH_VALIDATE_LOOP_INDEXING = UINT64_C(1) << 0;

Просмотреть файл

@ -14,11 +14,13 @@
#include <string>
#include <vector>
// Assume ShaderLang.h is included before ShaderVars.h, for sh::GLenum
// Note: make sure to increment ANGLE_SH_VERSION when changing ShaderVars.h
// This type is defined here to simplify ANGLE's integration with glslang for SPIRv.
using ShCompileOptions = uint64_t;
namespace sh
{
// GLenum alias
typedef unsigned int GLenum;
// Varying interpolation qualifier, see section 4.3.9 of the ESSL 3.00.4 spec
enum InterpolationType

Просмотреть файл

@ -11,8 +11,9 @@
#define LIBANGLE_PROGRAM_H_
#include <GLES2/gl2.h>
#include <GLSLANG/ShaderLang.h>
#include <GLSLANG/ShaderVars.h>
#include <map>
#include <set>
#include <sstream>
#include <string>