Commit b2792db1 by Corentin Wallez Committed by Commit Bot

translator: Reject invalid combination of compile flags

ADD_AND_TRUE_TO_LOOP_CONDITION breaks loop unrolling because LoopInfo expects the loop condition to have been validated to be "symbol < constant" and stayed that way. BUG=chromium:653454 BUG=chromium:653694 Change-Id: I2057fde3a308623bd2dd7571ee878dd42b1fdac3 Reviewed-on: https://chromium-review.googlesource.com/395306Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent e9e573bd
...@@ -476,6 +476,17 @@ bool TCompiler::compile(const char *const shaderStrings[], ...@@ -476,6 +476,17 @@ bool TCompiler::compile(const char *const shaderStrings[],
compileOptions |= SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL; compileOptions |= SH_FLATTEN_PRAGMA_STDGL_INVARIANT_ALL;
} }
ShCompileOptions unrollFlags =
SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX | SH_UNROLL_FOR_LOOP_WITH_SAMPLER_ARRAY_INDEX;
if ((compileOptions & SH_ADD_AND_TRUE_TO_LOOP_CONDITION) != 0 &&
(compileOptions & unrollFlags) != 0)
{
infoSink.info.prefix(EPrefixError);
infoSink.info
<< "Unsupported compile flag combination: unroll & ADD_TRUE_TO_LOOP_CONDITION";
return false;
}
TScopedPoolAllocator scopedAlloc(&allocator); TScopedPoolAllocator scopedAlloc(&allocator);
TIntermBlock *root = compileTreeImpl(shaderStrings, numStrings, compileOptions); TIntermBlock *root = compileTreeImpl(shaderStrings, numStrings, compileOptions);
......
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