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
if (qualifierType == "shared")
{
if (IsWebGLBasedSpec(mShaderSpec))
{
error(qualifierTypeLine, "Only std140 layout is allowed in WebGL", "shared");
}
qualifier.blockStorage = EbsShared;
}
else if (qualifierType == "packed")
{
if (IsWebGLBasedSpec(mShaderSpec))
{
error(qualifierTypeLine, "Only std140 layout is allowed in WebGL", "packed");
}
qualifier.blockStorage = EbsPacked;
}
else if (qualifierType == "std140")
......
......@@ -53,7 +53,7 @@ class TParseContext : angle::NonCopyable
mChecksPrecisionErrors(checksPrecErrors),
mFragmentPrecisionHighOnESSL1(false),
mDefaultMatrixPacking(EmpColumnMajor),
mDefaultBlockStorage(EbsShared),
mDefaultBlockStorage(IsWebGLBasedSpec(spec) ? EbsStd140 : EbsShared),
mDiagnostics(is),
mDirectiveHandler(ext,
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