Commit 92f5afde by John Kessenich

Placeholder fix for part of #1870.

Also fixes, in practice, https://github.com/KhronosGroup/GLSL/issues/83. When the specification language is correctly created, glslang can be revisited for correctness. In the meantime, this seems like the best "bug" to have relative to the specification. Memory qualifiers are only relevant to parameters when they apply to what the argument points to, as otherwise the argument is copied. This leaves the fix from #1870 in place, and then more correctly ignores memory qualifiers when something will be passed by copy.
parent 7de044c0
310.inheritMemory.frag
ERROR: 0:38: 'readonly' : argument cannot drop memory qualifier when passed to formal parameter
ERROR: 0:39: 'readonly' : argument cannot drop memory qualifier when passed to formal parameter
ERROR: 0:40: 'readonly' : argument cannot drop memory qualifier when passed to formal parameter
ERROR: 0:41: 'readonly' : argument cannot drop memory qualifier when passed to formal parameter
ERROR: 0:42: 'readonly' : argument cannot drop memory qualifier when passed to formal parameter
ERROR: 5 compilation errors. No code generated.
Shader version: 310
ERROR: node is still EOpNull!
0:? Sequence
0:18 Function Definition: non_ro_fun(f1[10]; ( global void)
0:18 Function Parameters:
0:18 'buff' ( in 10-element array of mediump float)
......@@ -120,7 +112,7 @@ Linked fragment stage:
Shader version: 310
ERROR: node is still EOpNull!
0:? Sequence
0:18 Function Definition: non_ro_fun(f1[10]; ( global void)
0:18 Function Parameters:
0:18 'buff' ( in 10-element array of mediump float)
......
......@@ -1152,8 +1152,9 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
if (lValueErrorCheck(arguments->getLoc(), "assign", arg->getAsTyped()))
error(arguments->getLoc(), "Non-L-value cannot be passed for 'out' or 'inout' parameters.", "out", "");
}
TQualifier& argQualifier = arg->getAsTyped()->getQualifier();
if (argQualifier.isMemory()) {
const TType& argType = arg->getAsTyped()->getType();
const TQualifier& argQualifier = argType.getQualifier();
if (argQualifier.isMemory() && (argType.containsOpaque() || argType.isReference())) {
const char* message = "argument cannot drop memory qualifier when passed to formal parameter";
if (argQualifier.volatil && ! formalQualifier.volatil)
error(arguments->getLoc(), message, "volatile", "");
......
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