Commit 7ebb97fc by Qiankun Miao Committed by Commit Bot

Use 64-bits compile options

BUG=chromium:645071 Change-Id: I31825123bf4cb45fb37a93f538e8936487beb5ff Reviewed-on: https://chromium-review.googlesource.com/382712 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 47cb73ab
......@@ -28,7 +28,7 @@ enum TFailCode
static void usage();
static sh::GLenum FindShaderType(const char *fileName);
static bool CompileFile(char *fileName, ShHandle compiler, int compileOptions);
static bool CompileFile(char *fileName, ShHandle compiler, 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);
......@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
{
TFailCode failCode = ESuccess;
int compileOptions = 0;
ShCompileOptions compileOptions = 0;
int numCompiles = 0;
ShHandle vertexCompiler = 0;
ShHandle fragmentCompiler = 0;
......@@ -378,7 +378,7 @@ sh::GLenum FindShaderType(const char *fileName)
//
// Read a file's data into a string, and compile it using ShCompile
//
bool CompileFile(char *fileName, ShHandle compiler, int compileOptions)
bool CompileFile(char *fileName, ShHandle compiler, ShCompileOptions compileOptions)
{
ShaderSource source;
if (!ReadShaderSource(fileName, source))
......
......@@ -154,7 +154,7 @@ TCompiler::~TCompiler()
{
}
bool TCompiler::shouldRunLoopAndIndexingValidation(int compileOptions) const
bool TCompiler::shouldRunLoopAndIndexingValidation(ShCompileOptions compileOptions) const
{
// If compiling an ESSL 1.00 shader for WebGL, or if its been requested through the API,
// validate loop and indexing as well (to verify that the shader only uses minimal functionality
......@@ -189,15 +189,16 @@ bool TCompiler::Init(const ShBuiltInResources& resources)
return true;
}
TIntermNode *TCompiler::compileTreeForTesting(const char* const shaderStrings[],
size_t numStrings, int compileOptions)
TIntermNode *TCompiler::compileTreeForTesting(const char *const shaderStrings[],
size_t numStrings,
ShCompileOptions compileOptions)
{
return compileTreeImpl(shaderStrings, numStrings, compileOptions);
}
TIntermNode *TCompiler::compileTreeImpl(const char *const shaderStrings[],
size_t numStrings,
const int compileOptions)
const ShCompileOptions compileOptions)
{
clearResults();
......@@ -393,12 +394,14 @@ TIntermNode *TCompiler::compileTreeImpl(const char *const shaderStrings[],
return NULL;
}
bool TCompiler::compile(const char *const shaderStrings[], size_t numStrings, int compileOptionsIn)
bool TCompiler::compile(const char *const shaderStrings[],
size_t numStrings,
ShCompileOptions compileOptionsIn)
{
if (numStrings == 0)
return true;
int compileOptions = compileOptionsIn;
ShCompileOptions compileOptions = compileOptionsIn;
// Apply key workarounds.
if (shouldFlattenPragmaStdglInvariantAll())
......@@ -852,7 +855,7 @@ const BuiltInFunctionEmulator& TCompiler::getBuiltInFunctionEmulator() const
return builtInFunctionEmulator;
}
void TCompiler::writePragma(int compileOptions)
void TCompiler::writePragma(ShCompileOptions compileOptions)
{
if (!(compileOptions & SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL))
{
......
......@@ -73,11 +73,13 @@ class TCompiler : public TShHandleBase
// compileTreeForTesting should be used only when tests require access to
// the AST. Users of this function need to manually manage the global pool
// allocator. Returns NULL whenever there are compilation errors.
TIntermNode *compileTreeForTesting(const char* const shaderStrings[],
size_t numStrings, int compileOptions);
TIntermNode *compileTreeForTesting(const char *const shaderStrings[],
size_t numStrings,
ShCompileOptions compileOptions);
bool compile(const char* const shaderStrings[],
size_t numStrings, int compileOptions);
bool compile(const char *const shaderStrings[],
size_t numStrings,
ShCompileOptions compileOptions);
// Get results of the last compilation.
int getShaderVersion() const { return shaderVersion; }
......@@ -102,7 +104,7 @@ class TCompiler : public TShHandleBase
ShShaderOutput getOutputType() const { return outputType; }
const std::string &getBuiltInResourcesString() const { return builtInResourcesString; }
bool shouldRunLoopAndIndexingValidation(int compileOptions) const;
bool shouldRunLoopAndIndexingValidation(ShCompileOptions compileOptions) const;
// Get the resources set by InitBuiltInSymbolTable
const ShBuiltInResources& getResources() const;
......@@ -123,9 +125,10 @@ class TCompiler : public TShHandleBase
// Collect info for all attribs, uniforms, varyings.
void collectVariables(TIntermNode* root);
// Add emulated functions to the built-in function emulator.
virtual void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, int compileOptions) {};
virtual void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
ShCompileOptions compileOptions){};
// Translate to object code.
virtual void translate(TIntermNode *root, int compileOptions) = 0;
virtual void translate(TIntermNode *root, ShCompileOptions compileOptions) = 0;
// Returns true if, after applying the packing rules in the GLSL 1.017 spec
// Appendix A, section 7, the shader does not use too many uniforms.
bool enforcePackingRestrictions();
......@@ -143,7 +146,7 @@ class TCompiler : public TShHandleBase
const TExtensionBehavior& getExtensionBehavior() const;
const char *getSourcePath() const;
const TPragma& getPragma() const { return mPragma; }
void writePragma(int compileOptions);
void writePragma(ShCompileOptions compileOptions);
unsigned int *getTemporaryIndex() { return &mTemporaryIndex; }
// Relies on collectVariables having been called.
bool isVaryingDefined(const char *varyingName);
......@@ -152,7 +155,7 @@ class TCompiler : public TShHandleBase
ShArrayIndexClampingStrategy getArrayIndexClampingStrategy() const;
const BuiltInFunctionEmulator& getBuiltInFunctionEmulator() const;
virtual bool shouldCollectVariables(int compileOptions)
virtual bool shouldCollectVariables(ShCompileOptions compileOptions)
{
return (compileOptions & SH_VARIABLES) != 0;
}
......@@ -182,7 +185,7 @@ class TCompiler : public TShHandleBase
TIntermNode *compileTreeImpl(const char *const shaderStrings[],
size_t numStrings,
const int compileOptions);
const ShCompileOptions compileOptions);
sh::GLenum shaderType;
ShShaderSpec shaderSpec;
......
......@@ -80,11 +80,14 @@ const TConstantUnion *WriteConstantUnionArray(TInfoSinkBase &out,
namespace sh
{
OutputHLSL::OutputHLSL(sh::GLenum shaderType, int shaderVersion,
const TExtensionBehavior &extensionBehavior,
const char *sourcePath, ShShaderOutput outputType,
int numRenderTargets, const std::vector<Uniform> &uniforms,
int compileOptions)
OutputHLSL::OutputHLSL(sh::GLenum shaderType,
int shaderVersion,
const TExtensionBehavior &extensionBehavior,
const char *sourcePath,
ShShaderOutput outputType,
int numRenderTargets,
const std::vector<Uniform> &uniforms,
ShCompileOptions compileOptions)
: TIntermTraverser(true, true, true),
mShaderType(shaderType),
mShaderVersion(shaderVersion),
......
......@@ -30,11 +30,14 @@ typedef std::map<TString, TIntermSymbol*> ReferencedSymbols;
class OutputHLSL : public TIntermTraverser
{
public:
OutputHLSL(sh::GLenum shaderType, int shaderVersion,
const TExtensionBehavior &extensionBehavior,
const char *sourcePath, ShShaderOutput outputType,
int numRenderTargets, const std::vector<Uniform> &uniforms,
int compileOptions);
OutputHLSL(sh::GLenum shaderType,
int shaderVersion,
const TExtensionBehavior &extensionBehavior,
const char *sourcePath,
ShShaderOutput outputType,
int numRenderTargets,
const std::vector<Uniform> &uniforms,
ShCompileOptions compileOptions);
~OutputHLSL();
......@@ -118,7 +121,7 @@ class OutputHLSL : public TIntermTraverser
const TExtensionBehavior &mExtensionBehavior;
const char *mSourcePath;
const ShShaderOutput mOutputType;
int mCompileOptions;
ShCompileOptions mCompileOptions;
bool mInsideFunction;
......
......@@ -33,7 +33,7 @@ class TParseContext : angle::NonCopyable
TExtensionBehavior &ext,
sh::GLenum type,
ShShaderSpec spec,
int options,
ShCompileOptions options,
bool checksPrecErrors,
TInfoSink &is,
const ShBuiltInResources &resources)
......@@ -407,16 +407,18 @@ class TParseContext : angle::NonCopyable
bool mDeferredSingleDeclarationErrorCheck;
sh::GLenum mShaderType; // vertex or fragment language (future: pack or unpack)
ShShaderSpec mShaderSpec; // The language specification compiler conforms to - GLES2 or WebGL.
int mCompileOptions; // Options passed to TCompiler
ShShaderSpec mShaderSpec; // The language specification compiler conforms to - GLES2 or WebGL.
ShCompileOptions mCompileOptions; // Options passed to TCompiler
int mShaderVersion;
TIntermNode *mTreeRoot; // root of parse tree being created
TIntermNode *mTreeRoot; // root of parse tree being created
int mLoopNestingLevel; // 0 if outside all loops
int mStructNestingLevel; // incremented while parsing a struct declaration
int mStructNestingLevel; // incremented while parsing a struct declaration
int mSwitchNestingLevel; // 0 if outside all switch statements
const TType *mCurrentFunctionType; // the return type of the function that's currently being parsed
const TType
*mCurrentFunctionType; // the return type of the function that's currently being parsed
bool mFunctionReturnsValue; // true if a non-void function has a return
bool mChecksPrecisionErrors; // true if an error will be generated when a variable is declared without precision, explicit or implicit.
bool mChecksPrecisionErrors; // true if an error will be generated when a variable is declared
// without precision, explicit or implicit.
bool mFragmentPrecisionHighOnESSL1; // true if highp precision is supported when compiling
// ESSL1.
TLayoutMatrixPacking mDefaultMatrixPacking;
......
......@@ -268,11 +268,10 @@ const std::string &ShGetBuiltInResourcesString(const ShHandle handle)
// Return: The return value of ShCompile is really boolean, indicating
// success or failure.
//
bool ShCompile(
const ShHandle handle,
const char *const shaderStrings[],
size_t numStrings,
int compileOptions)
bool ShCompile(const ShHandle handle,
const char *const shaderStrings[],
size_t numStrings,
ShCompileOptions compileOptions)
{
TCompiler *compiler = GetCompilerFromHandle(handle);
ASSERT(compiler);
......
......@@ -16,7 +16,7 @@ TranslatorESSL::TranslatorESSL(sh::GLenum type, ShShaderSpec spec)
{
}
void TranslatorESSL::translate(TIntermNode *root, int compileOptions)
void TranslatorESSL::translate(TIntermNode *root, ShCompileOptions compileOptions)
{
TInfoSinkBase& sink = getInfoSink().obj;
......
......@@ -15,7 +15,7 @@ class TranslatorESSL : public TCompiler
TranslatorESSL(sh::GLenum type, ShShaderSpec spec);
protected:
void translate(TIntermNode *root, int compileOptions) override;
void translate(TIntermNode *root, ShCompileOptions compileOptions) override;
bool shouldFlattenPragmaStdglInvariantAll() override;
private:
......
......@@ -20,7 +20,8 @@ TranslatorGLSL::TranslatorGLSL(sh::GLenum type,
: TCompiler(type, spec, output) {
}
void TranslatorGLSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, int compileOptions)
void TranslatorGLSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
ShCompileOptions compileOptions)
{
if (compileOptions & SH_EMULATE_ABS_INT_FUNCTION)
{
......@@ -31,7 +32,7 @@ void TranslatorGLSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, i
InitBuiltInFunctionEmulatorForGLSLMissingFunctions(emu, getShaderType(), targetGLSLVersion);
}
void TranslatorGLSL::translate(TIntermNode *root, int compileOptions)
void TranslatorGLSL::translate(TIntermNode *root, ShCompileOptions compileOptions)
{
TInfoSinkBase& sink = getInfoSink().obj;
......
......@@ -15,9 +15,10 @@ class TranslatorGLSL : public TCompiler
TranslatorGLSL(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output);
protected:
void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, int compileOptions) override;
void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
ShCompileOptions compileOptions) override;
void translate(TIntermNode *root, int compileOptions) override;
void translate(TIntermNode *root, ShCompileOptions compileOptions) override;
bool shouldFlattenPragmaStdglInvariantAll() override;
private:
......
......@@ -28,7 +28,7 @@ TranslatorHLSL::TranslatorHLSL(sh::GLenum type, ShShaderSpec spec, ShShaderOutpu
{
}
void TranslatorHLSL::translate(TIntermNode *root, int compileOptions)
void TranslatorHLSL::translate(TIntermNode *root, ShCompileOptions compileOptions)
{
const ShBuiltInResources &resources = getResources();
int numRenderTargets = resources.EXT_draw_buffers ? resources.MaxDrawBuffers : 1;
......
......@@ -21,11 +21,11 @@ class TranslatorHLSL : public TCompiler
const std::map<std::string, unsigned int> *getUniformRegisterMap() const;
protected:
void translate(TIntermNode *root, int compileOptions) override;
void translate(TIntermNode *root, ShCompileOptions compileOptions) override;
bool shouldFlattenPragmaStdglInvariantAll() override;
// collectVariables needs to be run always so registers can be assigned.
bool shouldCollectVariables(int compileOptions) override { return true; }
bool shouldCollectVariables(ShCompileOptions compileOptions) override { return true; }
std::map<std::string, unsigned int> mInterfaceBlockRegisterMap;
std::map<std::string, unsigned int> mUniformRegisterMap;
......
......@@ -243,9 +243,9 @@ void Shader::compile(Compiler *compiler)
std::stringstream sourceStream;
std::string sourcePath;
int additionalOptions =
ShCompileOptions additionalOptions =
mImplementation->prepareSourceAndReturnOptions(&sourceStream, &sourcePath);
int compileOptions = (SH_OBJECT_CODE | SH_VARIABLES | additionalOptions);
ShCompileOptions compileOptions = (SH_OBJECT_CODE | SH_VARIABLES | additionalOptions);
// Some targets (eg D3D11 Feature Level 9_3 and below) do not support non-constant loop indexes
// in fragment shaders. Shader compilation will fail. To provide a better error message we can
......
......@@ -22,8 +22,8 @@ class ShaderImpl : angle::NonCopyable
virtual ~ShaderImpl() { }
// Returns additional ShCompile options.
virtual int prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath) = 0;
virtual ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath) = 0;
// Returns success for compiling on the driver. Returns success.
virtual bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) = 0;
......
......@@ -133,12 +133,12 @@ ShShaderOutput ShaderD3D::getCompilerOutputType() const
return mCompilerOutputType;
}
int ShaderD3D::prepareSourceAndReturnOptions(std::stringstream *shaderSourceStream,
std::string *sourcePath)
ShCompileOptions ShaderD3D::prepareSourceAndReturnOptions(std::stringstream *shaderSourceStream,
std::string *sourcePath)
{
uncompile();
int additionalOptions = 0;
ShCompileOptions additionalOptions = 0;
const std::string &source = mData.getSource();
......
......@@ -28,8 +28,8 @@ class ShaderD3D : public ShaderImpl
virtual ~ShaderD3D();
// ShaderImpl implementation
int prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath) override;
ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath) override;
bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) override;
std::string getDebugInfo() const override;
......@@ -77,7 +77,7 @@ class ShaderD3D : public ShaderImpl
mutable std::string mDebugInfo;
std::map<std::string, unsigned int> mUniformRegisterMap;
std::map<std::string, unsigned int> mInterfaceBlockRegisterMap;
int mAdditionalOptions;
ShCompileOptions mAdditionalOptions;
};
} // namespace rx
......
......@@ -36,8 +36,8 @@ ShaderGL::~ShaderGL()
}
}
int ShaderGL::prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string * /*sourcePath*/)
ShCompileOptions ShaderGL::prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string * /*sourcePath*/)
{
// Reset the previous state
if (mShaderID != 0)
......@@ -48,7 +48,7 @@ int ShaderGL::prepareSourceAndReturnOptions(std::stringstream *sourceStream,
*sourceStream << mData.getSource();
int options = SH_INIT_GL_POSITION;
ShCompileOptions options = SH_INIT_GL_POSITION;
if (mWorkarounds.doWhileGLSLCausesGPUHang)
{
......
......@@ -25,8 +25,8 @@ class ShaderGL : public ShaderImpl
~ShaderGL() override;
// ShaderImpl implementation
int prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath) override;
ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath) override;
bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) override;
std::string getDebugInfo() const override;
......
......@@ -22,8 +22,8 @@ ShaderVk::~ShaderVk()
{
}
int ShaderVk::prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath)
ShCompileOptions ShaderVk::prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath)
{
UNIMPLEMENTED();
return int();
......
......@@ -22,8 +22,8 @@ class ShaderVk : public ShaderImpl
~ShaderVk() override;
// Returns additional ShCompile options.
int prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath) override;
ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream,
std::string *sourcePath) override;
// Returns success for compiling on the driver. Returns success.
bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) override;
......
......@@ -176,7 +176,7 @@ protected:
// to the issue we are testing.
bool CheckShaderCompilation(ShHandle compiler,
const char *source,
int compileOptions,
ShCompileOptions compileOptions,
const char *expected_error)
{
bool success = ShCompile(compiler, &source, 1, compileOptions) != 0;
......@@ -213,7 +213,7 @@ TEST_F(ExpressionLimitTest, ExpressionComplexity)
ShShaderOutput output = SH_ESSL_OUTPUT;
ShHandle vertexCompiler = ShConstructCompiler(
GL_FRAGMENT_SHADER, spec, output, &resources);
int compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
ShCompileOptions compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
// Test expression under the limit passes.
EXPECT_TRUE(CheckShaderCompilation(
......@@ -242,7 +242,7 @@ TEST_F(ExpressionLimitTest, UnusedExpressionComplexity)
ShShaderOutput output = SH_ESSL_OUTPUT;
ShHandle vertexCompiler = ShConstructCompiler(
GL_FRAGMENT_SHADER, spec, output, &resources);
int compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
ShCompileOptions compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
// Test expression under the limit passes.
EXPECT_TRUE(CheckShaderCompilation(
......@@ -271,7 +271,7 @@ TEST_F(ExpressionLimitTest, CallStackDepth)
ShShaderOutput output = SH_ESSL_OUTPUT;
ShHandle vertexCompiler = ShConstructCompiler(
GL_FRAGMENT_SHADER, spec, output, &resources);
int compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
ShCompileOptions compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
// Test call stack under the limit passes.
EXPECT_TRUE(CheckShaderCompilation(
......@@ -300,7 +300,7 @@ TEST_F(ExpressionLimitTest, UnusedCallStackDepth)
ShShaderOutput output = SH_ESSL_OUTPUT;
ShHandle vertexCompiler = ShConstructCompiler(
GL_FRAGMENT_SHADER, spec, output, &resources);
int compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
ShCompileOptions compileOptions = SH_LIMIT_CALL_STACK_DEPTH;
// Test call stack under the limit passes.
EXPECT_TRUE(CheckShaderCompilation(
......@@ -329,7 +329,7 @@ TEST_F(ExpressionLimitTest, Recursion)
ShShaderOutput output = SH_ESSL_OUTPUT;
ShHandle vertexCompiler = ShConstructCompiler(
GL_FRAGMENT_SHADER, spec, output, &resources);
int compileOptions = 0;
ShCompileOptions compileOptions = 0;
static const char* shaderWithRecursion0 = SHADER(
precision mediump float;
......@@ -544,7 +544,7 @@ TEST_F(ExpressionLimitTest, FunctionParameterCount)
ShShaderSpec spec = SH_WEBGL_SPEC;
ShShaderOutput output = SH_ESSL_OUTPUT;
ShHandle compiler = ShConstructCompiler(GL_FRAGMENT_SHADER, spec, output, &resources);
int compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
ShCompileOptions compileOptions = SH_LIMIT_EXPRESSION_COMPLEXITY;
// Test parameters under the limit succeeds.
EXPECT_TRUE(CheckShaderCompilation(
......
......@@ -51,7 +51,7 @@ class MalformedShaderTest : public testing::Test
protected:
std::string mInfoLog;
TranslatorESSL *mTranslator;
int mExtraCompileOptions;
ShCompileOptions mExtraCompileOptions;
};
class MalformedVertexShaderTest : public MalformedShaderTest
......
......@@ -49,7 +49,7 @@ bool compileTestShader(GLenum type,
ShShaderOutput output,
const std::string &shaderString,
ShBuiltInResources *resources,
int compileOptions,
ShCompileOptions compileOptions,
std::string *translatedCode,
std::string *infoLog)
{
......@@ -76,7 +76,7 @@ bool compileTestShader(GLenum type,
ShShaderSpec spec,
ShShaderOutput output,
const std::string &shaderString,
int compileOptions,
ShCompileOptions compileOptions,
std::string *translatedCode,
std::string *infoLog)
{
......@@ -86,7 +86,7 @@ bool compileTestShader(GLenum type,
}
MatchOutputCodeTest::MatchOutputCodeTest(GLenum shaderType,
int defaultCompileOptions,
ShCompileOptions defaultCompileOptions,
ShShaderOutput outputType)
: mShaderType(shaderType), mDefaultCompileOptions(defaultCompileOptions)
{
......@@ -109,7 +109,8 @@ void MatchOutputCodeTest::compile(const std::string &shaderString)
compile(shaderString, mDefaultCompileOptions);
}
void MatchOutputCodeTest::compile(const std::string &shaderString, const int compileOptions)
void MatchOutputCodeTest::compile(const std::string &shaderString,
const ShCompileOptions compileOptions)
{
std::string infoLog;
for (auto &code : mOutputCode)
......@@ -125,7 +126,7 @@ void MatchOutputCodeTest::compile(const std::string &shaderString, const int com
bool MatchOutputCodeTest::compileWithSettings(ShShaderOutput output,
const std::string &shaderString,
const int compileOptions,
const ShCompileOptions compileOptions,
std::string *translatedCode,
std::string *infoLog)
{
......
......@@ -22,7 +22,7 @@ bool compileTestShader(GLenum type,
ShShaderOutput output,
const std::string &shaderString,
ShBuiltInResources *resources,
int compileOptions,
ShCompileOptions compileOptions,
std::string *translatedCode,
std::string *infoLog);
......@@ -30,14 +30,16 @@ bool compileTestShader(GLenum type,
ShShaderSpec spec,
ShShaderOutput output,
const std::string &shaderString,
int compileOptions,
ShCompileOptions compileOptions,
std::string *translatedCode,
std::string *infoLog);
class MatchOutputCodeTest : public testing::Test
{
protected:
MatchOutputCodeTest(GLenum shaderType, int defaultCompileOptions, ShShaderOutput outputType);
MatchOutputCodeTest(GLenum shaderType,
ShCompileOptions defaultCompileOptions,
ShShaderOutput outputType);
void addOutputType(const ShShaderOutput outputType);
......@@ -45,7 +47,7 @@ class MatchOutputCodeTest : public testing::Test
// Compile functions clear any results from earlier calls to them.
void compile(const std::string &shaderString);
void compile(const std::string &shaderString, const int compileOptions);
void compile(const std::string &shaderString, const ShCompileOptions compileOptions);
bool foundInESSLCode(const char *stringToFind) const
{
......@@ -76,12 +78,12 @@ class MatchOutputCodeTest : public testing::Test
private:
bool compileWithSettings(ShShaderOutput output,
const std::string &shaderString,
int compileOptions,
ShCompileOptions compileOptions,
std::string *translatedCode,
std::string *infoLog);
GLenum mShaderType;
int mDefaultCompileOptions;
ShCompileOptions mDefaultCompileOptions;
ShBuiltInResources mResources;
std::map<ShShaderOutput, std::string> mOutputCode;
......
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