Commit 6e532b8c by Shahbaz Youssefi Committed by Commit Bot

Fix compute shared memory size validation

When a struct was involved, the required size for each field was added up, but also multiplied by its array size. However, when calculating the field size, the array size was already multipled in. This resulted in the calculated size to be larger than it actually is, resulting in failures in KHR-GLES31.core.compute_shader.shared-max. Bug: angleproject:4173 Change-Id: I900c17fa65decdeb20c3651c3342295fed2f7c61 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1953483Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 795a3559
......@@ -190,7 +190,7 @@ unsigned int ShaderVariable::getExternalSize() const
// Have a structure, need to compute the structure size.
for (const auto &field : fields)
{
memorySize += field.getArraySizeProduct() * field.getExternalSize();
memorySize += field.getExternalSize();
}
}
else
......
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