Commit db3e5183 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Fix col-major transformation of unsized arrays

If the row-major expression that was being transformed was in the form: arr.length() where `arr` is an SSBO unsized array, the translator transformation was attempting to transpose the `arr` expression, which is both wrong and impossible. Note that length() is removed through a prior transformation except for this particular case. This change recognizes this usage and supports it by keeping the expression as is (as the length() would be identical pre or post transformation). Bug: angleproject:3443 Change-Id: I8efacb7b12d5e53047eb56ab5d86830d81952d86 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1917422Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 430d4059
...@@ -888,6 +888,30 @@ class RewriteRowMajorMatricesTraverser : public TIntermTraverser ...@@ -888,6 +888,30 @@ class RewriteRowMajorMatricesTraverser : public TIntermTraverser
accessorIndex == 0 ? symbol : getAncestorNode(accessorIndex - 1); accessorIndex == 0 ? symbol : getAncestorNode(accessorIndex - 1);
TIntermNode *accessor = getAncestorNode(accessorIndex); TIntermNode *accessor = getAncestorNode(accessorIndex);
// if accessor is EOpArrayLength, we don't need to perform any transformations either.
// Note that this only applies to unsized arrays, as the RemoveArrayLengthMethod()
// transformation would have removed this operation otherwise.
TIntermUnary *accessorAsUnary = accessor->getAsUnaryNode();
if (requiresTransformation && accessorAsUnary && accessorAsUnary->getOp() == EOpArrayLength)
{
ASSERT(accessorAsUnary->getOperand() == originalExpression);
ASSERT(accessorAsUnary->getOperand()->getType().isUnsizedArray());
requiresTransformation = false;
// We need to replace the whole expression including the EOpArrayLength, to avoid
// confusing the replacement code as the original and new expressions don't have the
// same type (one is the transpose of the other). This doesn't affect the .length()
// operation, so this replacement is ok, though it's not worth special-casing this in
// the node replacement algorithm.
//
// Note: the |if (!requiresTransformation)| immediately below will be entered after
// this.
originalExpression = accessor;
accessor = getAncestorNode(accessorIndex + 1);
baseExpression = new TIntermUnary(EOpArrayLength, baseExpression, nullptr);
}
if (!requiresTransformation) if (!requiresTransformation)
{ {
ASSERT(primaryIndex == nullptr); ASSERT(primaryIndex == nullptr);
......
...@@ -80,18 +80,15 @@ ...@@ -80,18 +80,15 @@
3520 VULKAN : KHR-GLES31.core.internalformat.texture2d.* = FAIL 3520 VULKAN : KHR-GLES31.core.internalformat.texture2d.* = FAIL
// Crashes in libnvidia-glvkspirv.so, fixed in newer drivers // Crashes in libnvidia-glvkspirv.so, fixed in newer drivers
3561 VULKAN NVIDIA : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-*-matC* = SKIP 3561 VULKAN NVIDIA LINUX : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-*-matC* = SKIP
3561 VULKAN NVIDIA : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-vs-*-matC* = SKIP 3561 VULKAN NVIDIA LINUX : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-vs-*-matC* = SKIP
3561 VULKAN NVIDIA : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-*-matC* = SKIP 3561 VULKAN NVIDIA LINUX : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-*-matC* = SKIP
3561 VULKAN NVIDIA : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-*-struct* = SKIP 3561 VULKAN NVIDIA LINUX : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-*-struct* = SKIP
3561 VULKAN NVIDIA : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-vs-*-struct* = SKIP 3561 VULKAN NVIDIA LINUX : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-vs-*-struct* = SKIP
3561 VULKAN NVIDIA : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-*-struct* = SKIP 3561 VULKAN NVIDIA LINUX : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-*-struct* = SKIP
3561 VULKAN NVIDIA LINUX : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-*-matR* = SKIP
// Bug in RewriteRowMajorMatrices with row major SSBO matrix arrays with no size 3561 VULKAN NVIDIA LINUX : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-vs-*-matR* = SKIP
3443 VULKAN : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-cs-*-matR* = SKIP 3561 VULKAN NVIDIA LINUX : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-*-matR* = SKIP
3443 VULKAN : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-vs-*-matR* = SKIP
3443 VULKAN : KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-*-matR* = SKIP
3443 SWIFTSHADER : KHR-GLES31.core.shader_storage_buffer_object.advanced-switchBuffers-vs = SKIP
// Bug with GL_SHADER_STORAGE_BUFFER_START // Bug with GL_SHADER_STORAGE_BUFFER_START
3520 VULKAN : KHR-GLES31.core.shader_storage_buffer_object.basic-binding = FAIL 3520 VULKAN : KHR-GLES31.core.shader_storage_buffer_object.basic-binding = FAIL
......
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