Commit 0f59a2cb by Chris Forbes

Fix handling of pointer sizes; we want them to be 1

Bug: b/124388146 Change-Id: Id528368106eb0d09930ff4fccbe94704b585a531 Reviewed-on: https://swiftshader-review.googlesource.com/c/24599Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com>
parent a71b8e95
......@@ -161,8 +161,10 @@ namespace sw
object.storageClass = storageClass;
auto &type = getType(typeId);
auto &pointeeType = getType(type.definition.word(3));
object.sizeInComponents = type.sizeInComponents;
// OpVariable's "size" is the size of the allocation required (the size of the pointee)
object.sizeInComponents = pointeeType.sizeInComponents;
object.isBuiltInBlock = type.isBuiltInBlock;
// Register builtins
......@@ -379,9 +381,9 @@ namespace sw
}
case spv::OpTypePointer:
// Pointer 'size' is just pointee size
// TODO: this isn't really correct. we should look through pointers as appropriate.
return getType(insn.word(3)).sizeInComponents;
// Runtime representation of a pointer is a per-lane index.
// Note: clients are expected to look through the pointer if they want the pointee size instead.
return 1;
default:
// Some other random insn.
......
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