Commit 861ebb3b by Jamie Madill Committed by Commit Bot

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/412423Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 99bd5f40
...@@ -20,19 +20,12 @@ ...@@ -20,19 +20,12 @@
// and the shading language compiler. // 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 // Note: make sure to increment ANGLE_SH_VERSION when changing ShaderVars.h
#include "ShaderVars.h" #include "ShaderVars.h"
// Version number for shader translation API. // Version number for shader translation API.
// It is incremented every time the API changes. // It is incremented every time the API changes.
#define ANGLE_SH_VERSION 167 #define ANGLE_SH_VERSION 168
enum ShShaderSpec enum ShShaderSpec
{ {
...@@ -72,8 +65,8 @@ enum ShShaderOutput ...@@ -72,8 +65,8 @@ enum ShShaderOutput
}; };
// Compile options. // Compile options.
// The Compile options type is defined in ShaderVars.h, to allow ANGLE to import the ShaderVars
using ShCompileOptions = uint64_t; // header without needing the ShaderLang header. This avoids some conflicts with glslang.
const ShCompileOptions SH_VALIDATE = 0; const ShCompileOptions SH_VALIDATE = 0;
const ShCompileOptions SH_VALIDATE_LOOP_INDEXING = UINT64_C(1) << 0; const ShCompileOptions SH_VALIDATE_LOOP_INDEXING = UINT64_C(1) << 0;
......
...@@ -14,11 +14,13 @@ ...@@ -14,11 +14,13 @@
#include <string> #include <string>
#include <vector> #include <vector>
// Assume ShaderLang.h is included before ShaderVars.h, for sh::GLenum // This type is defined here to simplify ANGLE's integration with glslang for SPIRv.
// Note: make sure to increment ANGLE_SH_VERSION when changing ShaderVars.h using ShCompileOptions = uint64_t;
namespace sh namespace sh
{ {
// GLenum alias
typedef unsigned int GLenum;
// Varying interpolation qualifier, see section 4.3.9 of the ESSL 3.00.4 spec // Varying interpolation qualifier, see section 4.3.9 of the ESSL 3.00.4 spec
enum InterpolationType enum InterpolationType
......
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
#define LIBANGLE_PROGRAM_H_ #define LIBANGLE_PROGRAM_H_
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLSLANG/ShaderLang.h> #include <GLSLANG/ShaderVars.h>
#include <map>
#include <set> #include <set>
#include <sstream> #include <sstream>
#include <string> #include <string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment