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 ...@@ -161,8 +161,10 @@ namespace sw
object.storageClass = storageClass; object.storageClass = storageClass;
auto &type = getType(typeId); 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; object.isBuiltInBlock = type.isBuiltInBlock;
// Register builtins // Register builtins
...@@ -379,9 +381,9 @@ namespace sw ...@@ -379,9 +381,9 @@ namespace sw
} }
case spv::OpTypePointer: case spv::OpTypePointer:
// Pointer 'size' is just pointee size // Runtime representation of a pointer is a per-lane index.
// TODO: this isn't really correct. we should look through pointers as appropriate. // Note: clients are expected to look through the pointer if they want the pointee size instead.
return getType(insn.word(3)).sizeInComponents; return 1;
default: default:
// Some other random insn. // 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