Commit 3f5af3a4 by Alexis Hetu Committed by Alexis Hétu

Proper block size computations

Interface blocks can now properly return their size from TType::getElementSize() or TType::elementRegisterCount(). Change-Id: Ief69163088839784cf347160bb49fd64f1a2a395 Reviewed-on: https://swiftshader-review.googlesource.com/3584Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 0a65584a
......@@ -295,6 +295,10 @@ public:
{
return getStructSize();
}
else if(isInterfaceBlock())
{
return interfaceBlock->objectSize();
}
else if(isMatrix())
{
return primarySize * secondarySize;
......@@ -307,11 +311,11 @@ public:
int elementRegisterCount() const
{
if(structure)
if(structure || isInterfaceBlock())
{
int registerCount = 0;
const TFieldList& fields = getStruct()->fields();
const TFieldList& fields = isInterfaceBlock() ? interfaceBlock->fields() : structure->fields();
for(size_t i = 0; i < fields.size(); i++)
{
registerCount += fields[i]->type()->totalRegisterCount();
......
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