summaryrefslogtreecommitdiffstats
path: root/source/slang/type-layout.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-10 10:58:47 -0700
committerGitHub <noreply@github.com>2017-07-10 10:58:47 -0700
commit3c92fedbb73f76f3418630069c880bdc8aedccb4 (patch)
treee220ec5f54e5a5970a2307a87891a301d35f1546 /source/slang/type-layout.cpp
parent8abdf2dddd10feb9794c86cdf6b2159a2b6383e4 (diff)
parentd6d49eac224a0d03c8f941deb59ee1520ff0ab5e (diff)
Merge pull request #66 from tfoleyNV/falcor-work
Falcor work
Diffstat (limited to 'source/slang/type-layout.cpp')
-rw-r--r--source/slang/type-layout.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/slang/type-layout.cpp b/source/slang/type-layout.cpp
index 31c8ed607..9bc001e88 100644
--- a/source/slang/type-layout.cpp
+++ b/source/slang/type-layout.cpp
@@ -895,6 +895,28 @@ SimpleLayoutInfo GetLayoutImpl(
rules,
outTypeLayout);
}
+ else if (auto imageType = type->As<GLSLImageType>())
+ {
+ // TODO: the logic here should really be defined by the rules,
+ // and not at this top level...
+ ShaderParameterKind kind;
+ switch( imageType->getAccess() )
+ {
+ default:
+ kind = ShaderParameterKind::MutableImage;
+ break;
+
+ case SLANG_RESOURCE_ACCESS_READ:
+ kind = ShaderParameterKind::Image;
+ break;
+ }
+
+ return GetSimpleLayoutImpl(
+ rules->GetObjectLayout(kind),
+ type,
+ rules,
+ outTypeLayout);
+ }
else if (auto textureSamplerType = type->As<TextureSamplerType>())
{
// TODO: the logic here should really be defined by the rules,
@@ -1126,6 +1148,19 @@ SimpleLayoutInfo GetLayoutImpl(
return info;
}
}
+ else if (auto errorType = type->As<ErrorType>())
+ {
+ // An error type means that we encountered something we don't understand.
+ //
+ // We should probalby inform the user with an error message here.
+
+ SimpleLayoutInfo info;
+ return GetSimpleLayoutImpl(
+ info,
+ type,
+ rules,
+ outTypeLayout);
+ }
// catch-all case in case nothing matched
assert(!"unimplemented");