Commit 3971b19b by Chris Forbes

Fix accidentally considering Workgroup to be explicit layout

!IsStorageInterleavedByLane is not quite the same as IsExplicitLayout-- workgroup memory is the exception. Bug: b/133509497 Change-Id: I4dd055109c0e0f70fa415a75ee383e251cbd509c Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31929Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 74591720
......@@ -1235,6 +1235,19 @@ namespace sw
}
}
bool SpirvShader::IsExplicitLayout(spv::StorageClass storageClass)
{
switch (storageClass)
{
case spv::StorageClassUniform:
case spv::StorageClassStorageBuffer:
case spv::StorageClassPushConstant:
return true;
default:
return false;
}
}
bool SpirvShader::IsStorageInterleavedByLane(spv::StorageClass storageClass)
{
switch (storageClass)
......@@ -1407,7 +1420,7 @@ namespace sw
{
auto typeId = getObject(id).type;
auto const & type = getType(typeId);
if (!IsStorageInterleavedByLane(type.storageClass)) // TODO: really "is explicit layout"
if (IsExplicitLayout(type.storageClass))
{
Decorations d{};
ApplyDecorationsForId(&d, id);
......
......@@ -803,6 +803,7 @@ namespace sw
// LaneOffset=3: | Word[3] | Word[3] | Word[3] | Word[3]
//
static bool IsStorageInterleavedByLane(spv::StorageClass storageClass);
static bool IsExplicitLayout(spv::StorageClass storageClass);
template<typename F>
int VisitInterfaceInner(Type::ID id, Decorations d, F f) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment