#include "GLSLANG/ShaderLang.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <vector>
#include "angle_gl.h"
#if defined(ANGLE_ENABLE_VULKAN)
# include <spirv-tools/libspirv.hpp>
#endif
enum TFailCode
{ … };
static void usage();
static sh::GLenum FindShaderType(const char *fileName);
static bool CompileFile(char *fileName, ShHandle compiler, const ShCompileOptions &compileOptions);
static void LogMsg(const char *msg, const char *name, const int num, const char *logName);
static void PrintVariable(const std::string &prefix, size_t index, const sh::ShaderVariable &var);
static void PrintActiveVariables(ShHandle compiler);
const unsigned int NUM_SOURCE_STRINGS = …;
ShaderSource;
static bool ReadShaderSource(const char *fileName, ShaderSource &source);
static void FreeShaderSource(ShaderSource &source);
static bool ParseGLSLOutputVersion(const std::string &, ShShaderOutput *outResult);
static bool ParseIntValue(const std::string &, int emptyDefault, int *outValue);
static void PrintSpirv(const sh::BinaryBlob &blob);
void GenerateResources(ShBuiltInResources *resources)
{ … }
int main(int argc, char *argv[])
{ … }
void usage()
{ … }
sh::GLenum FindShaderType(const char *fileName)
{ … }
bool CompileFile(char *fileName, ShHandle compiler, const ShCompileOptions &compileOptions)
{ … }
void LogMsg(const char *msg, const char *name, const int num, const char *logName)
{ … }
void PrintVariable(const std::string &prefix, size_t index, const sh::ShaderVariable &var)
{ … }
static void PrintActiveVariables(ShHandle compiler)
{ … }
static bool ReadShaderSource(const char *fileName, ShaderSource &source)
{ … }
static void FreeShaderSource(ShaderSource &source)
{ … }
static bool ParseGLSLOutputVersion(const std::string &num, ShShaderOutput *outResult)
{ … }
static bool ParseIntValue(const std::string &num, int emptyDefault, int *outValue)
{ … }
static void PrintSpirv(const sh::BinaryBlob &blob)
{ … }