aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Kessenich <johnkslang@users.noreply.github.com>2016-10-28 19:16:13 -0600
committerGitHub <noreply@github.com>2016-10-28 19:16:13 -0600
commite19e68d4313617b8fe8bb68578d2de51507e603f (patch)
tree5fe6cb1bfae47261d6c81c49972c31370e3ff57f
parent9507885537e7c5a8db6f899e62c9819eae5a60fe (diff)
parentca7357044708cdc15b46124d72e86727fee09300 (diff)
downloadglslang-e19e68d4313617b8fe8bb68578d2de51507e603f.tar.gz
Merge pull request #571 from baldurk/explicit-lambda-returns
Add explicit lambda return types, for compilers without C++14 support
-rwxr-xr-xhlsl/hlslParseHelper.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp
index 4b9f7e38..a9e3a107 100755
--- a/hlsl/hlslParseHelper.cpp
+++ b/hlsl/hlslParseHelper.cpp
@@ -154,7 +154,7 @@ TLayoutFormat HlslParseContext::getLayoutFromTxType(const TSourceLoc& loc, const
{
const int components = txType.getVectorSize();
- const auto selectFormat = [this,&components](TLayoutFormat v1, TLayoutFormat v2, TLayoutFormat v4) {
+ const auto selectFormat = [this,&components](TLayoutFormat v1, TLayoutFormat v2, TLayoutFormat v4) -> TLayoutFormat {
if (intermediate.getNoStorageFormat())
return ElfNone;
@@ -260,7 +260,7 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char*
};
// Helper to complete sequence by adding trailing variable, so we evaluate to the right value.
- const auto finishSequence = [&](TIntermSymbol* rhsTmp, const TType& derefType) {
+ const auto finishSequence = [&](TIntermSymbol* rhsTmp, const TType& derefType) -> TIntermAggregate* {
// Add a trailing use of the temp, so the sequence returns the proper value.
sequence = intermediate.growAggregate(sequence, intermediate.addSymbol(*rhsTmp));
sequence->setOperator(EOpSequence);
@@ -279,7 +279,7 @@ TIntermTyped* HlslParseContext::handleLvalue(const TSourceLoc& loc, const char*
};
// helper to create a temporary variable
- const auto addTmpVar = [&](const char* name, const TType& derefType) {
+ const auto addTmpVar = [&](const char* name, const TType& derefType) -> TIntermSymbol* {
TVariable* tmpVar = makeInternalVariable(name, derefType);
tmpVar->getWritableType().getQualifier().makeTemporary();
return intermediate.addSymbol(*tmpVar, loc);
@@ -1440,7 +1440,7 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType
if (!node || !node->getAsOperator())
return;
- const auto clampReturn = [&loc, &node, this](TIntermTyped* result, const TSampler& sampler) {
+ const auto clampReturn = [&loc, &node, this](TIntermTyped* result, const TSampler& sampler) -> TIntermTyped* {
// Sampler return must always be a vec4, but we can construct a shorter vector
result->setType(TType(node->getType().getBasicType(), EvqTemporary, node->getVectorSize()));
@@ -2073,7 +2073,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
};
// Return true if this is an imageLoad, which we will change to an image atomic.
- const auto isImageParam = [](TIntermTyped* image) {
+ const auto isImageParam = [](TIntermTyped* image) -> bool {
TIntermAggregate* imageAggregate = image->getAsAggregate();
return imageAggregate != nullptr && imageAggregate->getOp() == EOpImageLoad;
};