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.
This commit is contained in:
@@ -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", "");
|
||||
|
||||
Reference in New Issue
Block a user