summaryrefslogtreecommitdiffstats
path: root/source/slang/type-layout.cpp
diff options
context:
space:
mode:
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");