Commit f0173153 by Olli Etuaho Committed by Commit Bot

Forbid shared and packed layouts in WebGL

WebGL 2.0 spec section 5.25 specifies this. BUG=angleproject:1542 TEST=WebGL 2 conformance tests Change-Id: Ic5758bc0e767a8e6dd032e42c0a69bcae06381c4 Reviewed-on: https://chromium-review.googlesource.com/399682Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 250ae902
...@@ -2865,10 +2865,18 @@ TLayoutQualifier TParseContext::parseLayoutQualifier(const TString &qualifierTyp ...@@ -2865,10 +2865,18 @@ TLayoutQualifier TParseContext::parseLayoutQualifier(const TString &qualifierTyp
if (qualifierType == "shared") if (qualifierType == "shared")
{ {
if (IsWebGLBasedSpec(mShaderSpec))
{
error(qualifierTypeLine, "Only std140 layout is allowed in WebGL", "shared");
}
qualifier.blockStorage = EbsShared; qualifier.blockStorage = EbsShared;
} }
else if (qualifierType == "packed") else if (qualifierType == "packed")
{ {
if (IsWebGLBasedSpec(mShaderSpec))
{
error(qualifierTypeLine, "Only std140 layout is allowed in WebGL", "packed");
}
qualifier.blockStorage = EbsPacked; qualifier.blockStorage = EbsPacked;
} }
else if (qualifierType == "std140") else if (qualifierType == "std140")
......
...@@ -53,7 +53,7 @@ class TParseContext : angle::NonCopyable ...@@ -53,7 +53,7 @@ class TParseContext : angle::NonCopyable
mChecksPrecisionErrors(checksPrecErrors), mChecksPrecisionErrors(checksPrecErrors),
mFragmentPrecisionHighOnESSL1(false), mFragmentPrecisionHighOnESSL1(false),
mDefaultMatrixPacking(EmpColumnMajor), mDefaultMatrixPacking(EmpColumnMajor),
mDefaultBlockStorage(EbsShared), mDefaultBlockStorage(IsWebGLBasedSpec(spec) ? EbsStd140 : EbsShared),
mDiagnostics(is), mDiagnostics(is),
mDirectiveHandler(ext, mDirectiveHandler(ext,
mDiagnostics, mDiagnostics,
......
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