BlamKiwi / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Add support for arrays as return values in output #971

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the WebGL 2 conformance test 
https://www.khronos.org/registry/webgl/sdk/tests/deqp/data/gles3/shaders/arrays.
html

What is the expected output? What do you see instead?
Expected: tests related to arrays as return values pass.
Actual: tests related to arrays as return values fail.

This is simple to fix for GLSL output, it just needs to write the array type 
correctly. HLSL output needs to be written so that the array is an out 
parameter instead of a return value.

Original issue reported on code.google.com by oetu...@nvidia.com on 13 Apr 2015 at 9:40

GoogleCodeExporter commented 9 years ago
Project: angle/angle
Branch : master
Author : Olli Etuaho <oetuaho@nvidia.com>
Commit : ab6fc6a2150963795e405a8faac1137cf7426d5d

Code-Review  0 : Nicolas Capens, Olli Etuaho
Code-Review  +1: Jamie Madill
Code-Review  +2: Geoff Lang
Verified     0 : Geoff Lang, Jamie Madill, Nicolas Capens
Verified     +1: Olli Etuaho
Commit Queue   : Chumped
Change-Id      : I63aa8c54d2696f65351b23acb0749a487298ddfb
Reviewed-at    : https://chromium-review.googlesource.com/265410

Add support for arrays as function return values in GLSL output

Output the array brackets and the array size correctly when a function's
return value type is array.

Tested with WebGL 2 test sdk/tests/deqp/data/gles3/shaders/arrays.html

BUG=angleproject:971
TEST=WebGL 2 conformance tests

src/compiler/translator/OutputGLSLBase.cpp

Original comment by bugdroid1@chromium.org on 15 Apr 2015 at 7:32

GoogleCodeExporter commented 9 years ago
The following revision refers to this bug:
  https://chromium.googlesource.com/angle/angle/+/a357236f481ddcdf4eb9fc5ace8509180c6ab783

commit a357236f481ddcdf4eb9fc5ace8509180c6ab783
Author: Olli Etuaho <oetuaho@nvidia.com>
Date: Fri May 22 13:15:01 2015

Fix small issues in array related AST transformations

Make sure that user-defined bit stays in place when copying function call
nodes, and that mInFunctionWithArrayReturnValue gets reset correctly in
ArrayReturnValueToOutParameter.

BUG=angleproject:971
TEST=WebGL 2 conformance tests

Change-Id: I385f4ce4990597e44ddad4f0fa6db23b661771dc
Reviewed-on: https://chromium-review.googlesource.com/273110
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>

[modify] 
http://crrev.com/a357236f481ddcdf4eb9fc5ace8509180c6ab783/src/compiler/translato
r/SeparateExpressionsReturningArrays.cpp
[modify] 
http://crrev.com/a357236f481ddcdf4eb9fc5ace8509180c6ab783/src/compiler/translato
r/ArrayReturnValueToOutParameter.cpp

Original comment by bugdroid1@chromium.org on 27 May 2015 at 6:00

GoogleCodeExporter commented 9 years ago
The following revision refers to this bug:
  https://chromium.googlesource.com/angle/angle/+/4f1af7847f100a51079e410d27385370c08080af

commit 4f1af7847f100a51079e410d27385370c08080af
Author: Olli Etuaho <oetuaho@nvidia.com>
Date: Mon May 25 08:55:07 2015

Handle function calls where returned array is not used

This is done by declaring a temporary variable which is passed as the
array out parameter defined by ArrayReturnValueToOutParameter.
SeparateExpressionsReturningArrays takes care of transforming the rest of
the cases where a function call returns an array into form that
ArrayReturnValueToOutParameter can handle.

BUG=angleproject:971
TEST=WebGL 2 conformance tests, dEQP-GLES3.functional.shaders.arrays.*

Change-Id: I70c07712ba5cd91efb4c2e575ecc49b9ef71bfd7
Reviewed-on: https://chromium-review.googlesource.com/273111
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>

[modify] 
http://crrev.com/4f1af7847f100a51079e410d27385370c08080af/src/compiler/translato
r/IntermTraverse.cpp
[modify] 
http://crrev.com/4f1af7847f100a51079e410d27385370c08080af/src/compiler/translato
r/ArrayReturnValueToOutParameter.h
[modify] 
http://crrev.com/4f1af7847f100a51079e410d27385370c08080af/src/compiler/translato
r/ArrayReturnValueToOutParameter.cpp
[modify] 
http://crrev.com/4f1af7847f100a51079e410d27385370c08080af/src/compiler/translato
r/TranslatorHLSL.cpp
[modify] 
http://crrev.com/4f1af7847f100a51079e410d27385370c08080af/src/compiler/translato
r/IntermNode.h

Original comment by bugdroid1@chromium.org on 27 May 2015 at 12:48