Updated glslang.

This commit is contained in:
Бранимир Караџић 2022-08-06 22:35:08 -07:00
parent ea8f609ef6
commit 88e976ced3
3 changed files with 9 additions and 6 deletions

View File

@ -7035,12 +7035,14 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
TFunction realFunc(&name, function->getType());
// Use copyParam to avoid shared ownership of the 'type' field
// of the parameter.
for (int i = 0; i < function->getParamCount(); ++i) {
realFunc.addParameter((*function)[i]);
realFunc.addParameter(TParameter().copyParam((*function)[i]));
}
TParameter tmpP = { 0, &uintType };
realFunc.addParameter(tmpP);
realFunc.addParameter(TParameter().copyParam(tmpP));
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true));
result = handleFunctionCall(loc, &realFunc, arguments);
@ -7053,11 +7055,11 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
TFunction realFunc(&name, function->getType());
for (int i = 0; i < function->getParamCount(); ++i) {
realFunc.addParameter((*function)[i]);
realFunc.addParameter(TParameter().copyParam((*function)[i]));
}
TParameter tmpP = { 0, &uintType };
realFunc.addParameter(tmpP);
realFunc.addParameter(TParameter().copyParam(tmpP));
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true));
result = handleFunctionCall(loc, &realFunc, arguments);

View File

@ -383,7 +383,7 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) {
TParameter param;
parameters.push_back(param);
parameters.back().copyParam(copyOf.parameters[i]);
(void)parameters.back().copyParam(copyOf.parameters[i]);
}
extensions = nullptr;

View File

@ -224,7 +224,7 @@ struct TParameter {
TString *name;
TType* type;
TIntermTyped* defaultValue;
void copyParam(const TParameter& param)
TParameter& copyParam(const TParameter& param)
{
if (param.name)
name = NewPoolTString(param.name->c_str());
@ -232,6 +232,7 @@ struct TParameter {
name = 0;
type = param.type->clone();
defaultValue = param.defaultValue;
return *this;
}
TBuiltInVariable getDeclaredBuiltIn() const { return type->getQualifier().declaredBuiltIn; }
};