src/compiler


Log

Author Commit Date CI Message
Jonah Ryan-Davis eaf56133 2019-03-13T12:56:49 gl_VertexID is incorrect if offset argument to glDrawArrays is non-zero On D3D the vertex ID is always indexed from 0, unlike GL. The D3D backend had assumed the wrong behavior. This forwards the true offset to D3D by using the ConstantsBuffer. Bug: angleproject:3090 Change-Id: Ia19e3490503c97541af14979b75af0c94c67ab6b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1520988 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia c9bc33cf 2019-03-04T17:31:05 Disable the initialization of shared memory This patch disables the initialization of shared memory for d3d backend. The initialization of shared memory is very slow and may produce incorrect behavior for some compute shaders on d3d backend. Bug: angleproject:3226 Change-Id: I41f0f061a5611c52af7667f23938fa48819906b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1498385 Reviewed-by: Jamie Madill (use @chromium please) <jmadill@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Jamie Madill 0f34f3f2 2019-03-11T10:18:57 Use auto_script in run_code_generation. Cleans up the generator scripts to prepare for listing outputs in the generated hashes file. Also reorganizes the scripts somewhat to make them a bit more maintainable. Bug: angleproject:3227 Change-Id: If40946c2004941d3f6cd51d5521c7db8cc0b52df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1512052 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis f563fdc9 2019-01-31T13:53:59 Reland "Fix unit test for setting locale creating malformed HLSL shader code Fix malformed HLSL shader code in other locales than classic" This is a reland of 5f662c0042703344eb0eef6d1c123e902e3aefbf Original change's description: > Fix unit test for setting locale creating malformed HLSL shader code > Fix malformed HLSL shader code in other locales than classic > > Bug: angleproject:1433 > Change-Id: I30bad0bd0cfda465ec7200e48e12800d7d8efd26 > Reviewed-on: https://chromium-review.googlesource.com/c/1447862 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Bug: angleproject:1433 Change-Id: I94caf7b4c7179119e5a5567c3014d7232df45a13 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1516192 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Tobin Ehlis 5546fb4f 2019-01-17T12:25:54 Vulkan:Adding custom pool allocator Migrated pool allocator used by compiler to common. Planning to use this for ANGLE custom command buffers so this some refactoring in preparation for that work. Added a unit test to check PoolAllocator functionality. Bug: angleproject:2951 Reviewed-on: https://chromium-review.googlesource.com/c/1476953 Reviewed-by: Jamie Madill <jmadill@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com> Change-Id: I0b4f3d55ea1799e35c9799c221f7129233f30b24 Reviewed-on: https://chromium-review.googlesource.com/c/1492972
Yuly Novikov 0546b538 2019-02-25T22:47:17 Revert "Vulkan:Adding custom pool allocator" This reverts commit 941717496141b96f1d5817f31c2bb4a4e19847b9. Reason for revert: crashes on Debug bots Original change's description: > Vulkan:Adding custom pool allocator > > Migrated pool allocator used by compiler to common. > > Planning to use this for ANGLE custom command buffers so this some > refactoring in preparation for that work. > > Added a unit test to check PoolAllocator functionality. > > Bug: angleproject:2951 > Change-Id: I29618cfdb065b8a5fefd40719a35d27b1f6e99ef > Reviewed-on: https://chromium-review.googlesource.com/c/1476953 > Reviewed-by: Jamie Madill <jmadill@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Tobin Ehlis <tobine@google.com> TBR=ynovikov@chromium.org,jmadill@google.com,tobine@google.com,syoussefi@chromium.org Change-Id: Id8c522bd1d94154e871211d975e801a55cc9c257 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2951, angleproject:3169 Reviewed-on: https://chromium-review.googlesource.com/c/1487977 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Tobin Ehlis 94171749 2019-01-17T12:25:54 Vulkan:Adding custom pool allocator Migrated pool allocator used by compiler to common. Planning to use this for ANGLE custom command buffers so this some refactoring in preparation for that work. Added a unit test to check PoolAllocator functionality. Bug: angleproject:2951 Change-Id: I29618cfdb065b8a5fefd40719a35d27b1f6e99ef Reviewed-on: https://chromium-review.googlesource.com/c/1476953 Reviewed-by: Jamie Madill <jmadill@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jonah Ryan-Davis 1d35d511 2019-02-15T15:39:27 Revert "Fix unit test for setting locale creating malformed HLSL shader code" This reverts commit 5f662c0042703344eb0eef6d1c123e902e3aefbf. Reason for revert: Some recent crashes related to streams, could be related to this change. https://bugs.chromium.org/p/chromium/issues/detail?id=932359 Original change's description: > Fix unit test for setting locale creating malformed HLSL shader code > Fix malformed HLSL shader code in other locales than classic > > Bug: angleproject:1433 > Change-Id: I30bad0bd0cfda465ec7200e48e12800d7d8efd26 > Reviewed-on: https://chromium-review.googlesource.com/c/1447862 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> TBR=geofflang@chromium.org,jmadill@chromium.org,jonahr@google.com Bug: angleproject:1433 Change-Id: I28caa073b3996a95f3f233bed9dc91dc44263835 Reviewed-on: https://chromium-review.googlesource.com/c/1474624 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 366df2b2 2019-01-18T15:40:34 Vulkan: Support external texture binding points. BUG=angleproject:2668 BUG=angleproject:3023 Change-Id: Idab0c4cbe1c7ed203ace50f1a6701dba11a40242 Reviewed-on: https://chromium-review.googlesource.com/c/1422548 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Natasha Lee 75d577fb 2019-02-04T16:28:28 Fixed Bug where array initialized with same name of previously declared variable fails on DirectX. Combined user defined variables with their unique ids to avoid overwriting same name variables of different scope. Bug: angleproject:2126 Change-Id: If9ad9e48f629d83b105d43ee28a50b8176d0e0a1 Reviewed-on: https://chromium-review.googlesource.com/c/1456484 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Jonah Ryan-Davis 5f662c00 2019-01-31T13:53:59 Fix unit test for setting locale creating malformed HLSL shader code Fix malformed HLSL shader code in other locales than classic Bug: angleproject:1433 Change-Id: I30bad0bd0cfda465ec7200e48e12800d7d8efd26 Reviewed-on: https://chromium-review.googlesource.com/c/1447862 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jonah Ryan-Davis d4c09dd3 2019-01-29T11:22:54 Fix unnecessary copy of for loop variables in ANGLE Bug: angleproject:3075 Change-Id: I34dd5d4ecded6def5a2b46369277312af0de7c8c Reviewed-on: https://chromium-review.googlesource.com/c/1443572 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill c09ae15c 2019-02-01T14:16:32 Enable -Wextra-semi and -Wextra-semi-stmt. This will prevent users from accidentally making semicolon errors in the future. Bug: chromium:926235 Change-Id: I79a6fa376fb1ad8f0fcf1b65b1f572a035d1f4e9 Reviewed-on: https://chromium-review.googlesource.com/c/1446493 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 91d469aa 2018-08-27T10:47:25 Initial support for compiler AST validation This is to be able to catch issues introduced through AST manipulation earlier than shader compilation time, improving debuggability. Bug: angleproject:2733 Change-Id: Ic57bc72f2ab438e60f32553d602074f3d72cc4f5 Reviewed-on: https://chromium-review.googlesource.com/c/1199922 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Qin Jiajia 1a07524d 2019-01-31T14:50:06 Fix the misuse of deepCopy() When we use replaceChildNode function, the first argument must be the original child node instead of the deepCopy. Otherwise, replaceChildNode will do nothing since it will think deepCopy is a different node. In that case, RewriteExpressionsWithShaderStorageBlockTraverser::visitAggregate will enter an endless loop since ssbo argument is never really replaced. Test: dEQP-GLES31.functional.ssbo.* Bug: angleproject:1951 Change-Id: Ieb17a16ab2b3e0270328fafd7ba0944ca05f842f Reviewed-on: https://chromium-review.googlesource.com/c/1446686 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Nico Weber a7429204 2019-01-30T09:29:06 Remove some extra semicolons. No behavior change. Bug: chromium:926235 Change-Id: I9215b4799a3c68887b8403be057180796ab5777a Reviewed-on: https://chromium-review.googlesource.com/c/1446311 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org>
Tobin Ehlis 47ca1b2f 2019-01-23T16:11:41 Revert "Vulkan: Adding custom pool allocator" This reverts commit 05459e06fde5047ae8f5f90fe091c3255e6bc88e. Reason for revert: Clusterfuzz bugs flagged this commit Original change's description: > Vulkan: Adding custom pool allocator > > Copied pool allocator used by compiler to common and hooking it up as > custom allocator for CommandPools. Modified it to support reallocation. > > RendererVk now has a private poolAllocator and VkAllocationCallbacks > struct. The allocation callbacks are initialized to static functions > in RendererVk::initializeDevice() and then passed to CommandPool init() > and destroy() functions. > > Using the pool allocator saves Command Pool/Buffer clean-up time which > was showing us as a bottleneck is some cases. > > Bug: angleproject:2951 > Change-Id: I81aa8a7ec60397676fa722d6435029db27947ef4 > Reviewed-on: https://chromium-review.googlesource.com/c/1409867 > Commit-Queue: Tobin Ehlis <tobine@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=jmadill@chromium.org,tobine@google.com,ianelliott@google.com,syoussefi@chromium.org Change-Id: I363a351667c4dddef79833061790da90de477e70 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2951 Reviewed-on: https://chromium-review.googlesource.com/c/1430679 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis 05459e06 2019-01-17T12:25:54 Vulkan: Adding custom pool allocator Copied pool allocator used by compiler to common and hooking it up as custom allocator for CommandPools. Modified it to support reallocation. RendererVk now has a private poolAllocator and VkAllocationCallbacks struct. The allocation callbacks are initialized to static functions in RendererVk::initializeDevice() and then passed to CommandPool init() and destroy() functions. Using the pool allocator saves Command Pool/Buffer clean-up time which was showing us as a bottleneck is some cases. Bug: angleproject:2951 Change-Id: I81aa8a7ec60397676fa722d6435029db27947ef4 Reviewed-on: https://chromium-review.googlesource.com/c/1409867 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 15214423 2019-01-07T12:44:44 ES31: Add top_level_array_stride support Bug: angleproject:1920 Change-Id: Id18c6cc1bb840c05f73a019156c462886f01d9eb Reviewed-on: https://chromium-review.googlesource.com/c/1396745 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill ab2bfa81 2019-01-15T19:06:47 Enable Chromium clang style plugin for libANGLE. This fixes a few style warnings: * auto should not deduce to raw pointer type * inlined virtual methods are not allowed * non-trivial constructors and destructors should be explicit * inlined non-trivial constructors should not be in-class * missing override keywords Bug: angleproject:3069 Change-Id: I3b3e55683691da3ebf6da06a5d3c729c71b6ee53 Reviewed-on: https://chromium-review.googlesource.com/c/1407640 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 5f82dde6 2019-01-14T11:38:33 Fix block size calculation w.r.t variable-size arrays In SSBOs, there can be a last array whose size is not specified (i.e. can take any size). This is especially prevalent in Compute shaders that process a buffer. In the shader translator, the size of this array is given as 0. HLSL register offset calculation was tripped up by this as it used (arraySize - 1). The optimization in [1] effectively removed a test that would perform this calculation only when the size is positive. This change adds back this guard. [1] https://chromium-review.googlesource.com/c/angle/angle/+/684742 Bug: angleproject:2516 Change-Id: If45ac934f542c5ffcad67f962eebe45a3aeba70b Reviewed-on: https://chromium-review.googlesource.com/c/1409403 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinghua Cao f3179a6a 2018-07-12T16:22:06 ES31: Implement bindImageTexture binds a single layer on D3D backend Dynamically generate image2D variables' declaration and function definition in libANGLE. Bug: angleproject:1987 TEST=angle_end2end_tests.ComputeShaderTest.* Change-Id: Idacc756f7bd15f22eccb1d689e18e997f3e74159 Reviewed-on: https://chromium-review.googlesource.com/c/1142885 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 225f08bf 2019-01-03T15:59:29 Cleanups to StripArrayIndices. Not picked up in prior review. Bug: angleproject:3024 Change-Id: I9dd1ea146996c8ac3569070af0cb12df65f0d815 Reviewed-on: https://chromium-review.googlesource.com/c/1394570 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4e712be2 2019-01-03T13:53:59 Refactor BlockLayoutEncoder APIs for std430. This splits HLSL SSBO access into two steps. First we compute a mapping from the collected SSBO variable names to TField pointers. Then during tree traversal we use a block encoding visitor class that uses the shader names to store BlockMemberInfo structures for the structures and variables. Each nested structure is traversed separately so that the BlockMemberInfo offsets are relative to the structure start rather than the enclosing block. The array stride for a structure is the size of the struct after all the alignment is included. This gives the correct results for the SSBO access chain in the HLSL code. It also will allow us to use the same encoding and visiting logic for SSBOs on the API side. Bug: angleproject:3024 Change-Id: I42b1db0e7547782ae77fe5f64a797f803f203f45 Reviewed-on: https://chromium-review.googlesource.com/c/1352731 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 904bb918 2019-01-02T16:00:02 Rename constants in blocklayout.h. This adds the "k" prefix. Bug: angleproject:3024 Change-Id: I3771a8a9d90cd5edc7173f2b3817a5f1f053bdd4 Reviewed-on: https://chromium-review.googlesource.com/c/1392399 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 04ea03e4 2019-01-01T15:14:25 Make default block member info a constant. Instead of generating a struct each time we can use a constexpr constructor to use a single representation. Bug: angleproject:3024 Change-Id: I14dec65a4f6ac9ab2f7e7af444862e4ceab88d8c Reviewed-on: https://chromium-review.googlesource.com/c/1392395 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ba319ba3 2018-12-29T10:29:33 Re-land "Load entry points dynamically in tests and samples." Fixes the Android/ChromeOS/Fuchsia builds by using consistent EGL headers. This CL adds a dynamic loader generator based on XML files. It also refactors the entry point generation script to move the XML parsing into a helper class. Additionally this includes a new GLES 1.0 base header. The new header allows for function pointer types and hiding prototypes. All tests and samples now load ANGLE dynamically. In the future this will be extended to load entry points from the driver directly when possible. This will allow us to perform more accurate A/B testing. The new build configuration leads to some tests having more warnings applied. The CL includes fixes for the new warnings. Bug: angleproject:2995 Change-Id: I5a8772f41a0f89570b3736b785f44b7de1539b57 Reviewed-on: https://chromium-review.googlesource.com/c/1392382 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 9f088621 2018-12-29T20:46:15 Revert "Load entry points dynamically in tests and samples." This reverts commit 03923558a7103827ffec6a4d2a1453ed91f01c6f. Reason for revert: fails compilation on Android, ChromeOS and Fuchsia during roll https://chromium-review.googlesource.com/c/chromium/src/+/1392624 Original change's description: > Load entry points dynamically in tests and samples. > > This CL adds a dynamic loader generator based on XML files. It also > refactors the entry point generation script to move the XML parsing > into a helper class. > > Additionally this includes a new GLES 1.0 base header. The new > header allows for function pointer types and hiding prototypes. > > All tests and samples now load ANGLE dynamically. In the future this > will be extended to load entry points from the driver directly when > possible. This will allow us to perform more accurate A/B testing. > > The new build configuration leads to some tests having more warnings > applied. The CL includes fixes for the new warnings. > > Bug: angleproject:2995 > Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05 > Reviewed-on: https://chromium-review.googlesource.com/c/1359516 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> TBR=ynovikov@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: I902bec2d733c2b879be29c02ab52a0b7d4eaa077 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2995 Reviewed-on: https://chromium-review.googlesource.com/c/1392381 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 03923558 2018-12-29T10:29:33 Load entry points dynamically in tests and samples. This CL adds a dynamic loader generator based on XML files. It also refactors the entry point generation script to move the XML parsing into a helper class. Additionally this includes a new GLES 1.0 base header. The new header allows for function pointer types and hiding prototypes. All tests and samples now load ANGLE dynamically. In the future this will be extended to load entry points from the driver directly when possible. This will allow us to perform more accurate A/B testing. The new build configuration leads to some tests having more warnings applied. The CL includes fixes for the new warnings. Bug: angleproject:2995 Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05 Reviewed-on: https://chromium-review.googlesource.com/c/1359516 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 8c78ce4b 2018-12-16T19:14:58 Use visitor pattern for Shader Variable APIs. In many places in ANGLE we need to traverse a ShaderVariable tree. We do this to store uniform offset and other information, to flatten the tree of uniforms for the front-end, or to produce active variable lists for uniform and shader storage blocks. In each case, we would write separate tree traversal code. This patch introduces a shared visitor pattern for all of the shader variable tree traversal instances. With that get more common code. Also it is easier to write new variable traversals. ProgramD3D and ProgramLinkedResources in particular get nice simplificiations. The visitor object recieves callbacks from the traversal when entering structs, array elements, and new variables. The visitor can treat these differently depending on the use case. A common visitor that constructs full variable names is used as a base class in several places. Also moves the 'isRowMajorLayout' from sh::InterfaceBlockField to sh::ShaderVariable. This allows us to forgo using templates in several call sites. Bug: angleproject:3024 Change-Id: I472d81ec775e2eee92fb3d2eb0ca83860221ba2e Reviewed-on: https://chromium-review.googlesource.com/c/1358722 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 2b35654d 2018-12-20T12:43:37 compiler: Fix const non-square matrix component mult. It seems like there weren't any dEQP tests for constant folding of nonsquare matrices component-wise multiplication. There were a couple bugs in our implementation which could lead to undefined behaviour. Fixes the code and cleans up a few style issues. Also includes a regression test. Bug: chromium:912505 Bug: chromium:912508 Change-Id: I7fb85d1404a32950fa9fe4c3bbba9edc9f38ddd1 Reviewed-on: https://chromium-review.googlesource.com/c/1387065 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Xinghua Cao 0d218da4 2018-12-17T11:53:52 Specify texture LOD in compute shader on D3D backend D3D does not define LOD in compute shader, so Sample() is not supported, try to use SampleLevel(). Bug: angleproject:2756 TEST=angle_end2end_tests.ComputeShaderTest .TextureFunction/ES3_1_D3D11 dEQP.GLES31/functional_image_load_store_2d_store* Change-Id: I63e707d2b56e807cfe766cc21bc6b0819982ce80 Reviewed-on: https://chromium-review.googlesource.com/c/1379672 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 4622905b 2018-12-10T13:31:00 ES31: Add atomic memory functions for SSBO Due to SSBO is translated to RWByteAddressBuffer in HLSL, the corresponding atomic memory functions atomic* will be translated to RWByteAddressBuffer.Interlocked*. The translation is like below: atomicAdd(instanceName.data[0], 5u); // becomes uint _ssbo_atomicAdd_uint(RWByteAddressBuffer buffer, uint loc, uint value) { uint original_value; buffer.InterlockedAdd(loc, value, original_value); return original_value; } _ssbo_atomicAdd_uint(_instanceName, 0 + 16 * 0, 5); Bug: angleproject:1951 Change-Id: If2af8bedb67a4135b443d2512d43c6058a78888d Reviewed-on: https://chromium-review.googlesource.com/c/1370676 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Qin Jiajia 4a9f9b08 2018-12-06T17:49:39 ES31: support ssbo as the operand of unary operator Bug: angleproject:1951 Change-Id: I71c2cf2ca35d7b1fe5d14358a0749f47e223816b Reviewed-on: https://chromium-review.googlesource.com/c/1367405 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Qin Jiajia 88faa696 2018-12-03T16:22:24 ES31: Add unsized array length support in SSBO Bug: angleproject:1951 Change-Id: I10c798c62a741b156f5b614e0df0795c0e845108 Reviewed-on: https://chromium-review.googlesource.com/c/1365154 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Qin Jiajia a48f26fb 2018-12-11T16:54:51 ES31: Use deepCopy to make sure that every node being used only once This patch uses deepCopy for nodes which are used more than once in the SSBO traverser. Bug: angleproject:1951 Change-Id: Ie8e03d4f595484a1e2ca0397ed30a7f484add607 Reviewed-on: https://chromium-review.googlesource.com/c/1370678 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Austin Eng 153e0224 2018-12-07T13:31:31 Add gl_DrawID emulation for ESSL3 with ANGLE_multi_draw Bug: chromium:890539 Change-Id: I3d9a9429608afb454f076013f3ed844e115c56cc Reviewed-on: https://chromium-review.googlesource.com/c/1368784 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
Qin Jiajia 19f2f9eb 2018-12-07T15:10:48 Mark variable to call 'length()' as statically used Bug: angleproject:3008 Change-Id: I8779706c667f49fddb0a741f5bf31c4af54db3e7 Reviewed-on: https://chromium-review.googlesource.com/c/1367404 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Qin Jiajia e14feaf5 2018-11-29T16:29:54 ES31: support ssbo as an argument of aggregate type BUG: angleproject:1951 Change-Id: Icaab8ffd0ee88cca22ba79a9f0d4e02c9134a169 Reviewed-on: https://chromium-review.googlesource.com/c/1349071 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 81a880aa 2018-11-12T15:53:34 ES31: support ssbo as binary operand This patch will process ssbo as compound assignment binary operand or readonly binary operand. BUG: angleproject:1951 Change-Id: I4a0da77649d719fa08e6bf4c3d9ace58dbfb7aab Reviewed-on: https://chromium-review.googlesource.com/c/1349449 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Qin Jiajia 6494c415 2018-11-05T15:46:04 ES31: Add swizzle support in SSBO (Part 1) This patch adds the swizzle process if the swizzle node is the last node in ssbo access chain. Bug: angleproject:1951 Change-Id: Iecc95baa45e8cc40be9111a15398c7e858bfb99e Reviewed-on: https://chromium-review.googlesource.com/c/1341234 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
jchen10 efe061bd 2018-11-13T16:44:40 Optimize HLSL zero initializer Currently we initialize a variable using zero initializer. Take the below variable for example: uint var[4]; We translate it to: uint var[4] = { 0, 0, 0, 0}; If the array size is large, we have to use very long zero initializer. The problem is that it's very slow for D3D drivers to compile. This CL uses the 'static' trick below to solve the problem: static uint _ANGLE_ZEROS_[256]; ... uint var[516] = {_ANGLE_ZEROS_, _ANGLE_ZEROS_, 0, 0, 0, 0}; For 'static', if the declaration does not include an initializer, the value is set to zero. https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-variable-syntax Bug: chromium:898030 Change-Id: Ia3f6574b5ddaffa94bf971140eba95835ee105ee Reviewed-on: https://chromium-review.googlesource.com/c/1332805 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Geoff Lang 6aab06e0 2018-11-20T14:04:11 Don't allow unary operators on void types. BUG=900058 Change-Id: Ice8976ddd9cbc9c90162cf7fae2b8f91ddcfcef3 Reviewed-on: https://chromium-review.googlesource.com/c/1344590 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Qin Jiajia b81ff9e6 2018-10-26T17:20:50 ES31: Add std430 encoder. Bug: angleproject:1951 Change-Id: I5e469ee5f13604102b0ee268d5bf9f5ac4809ecd Reviewed-on: https://chromium-review.googlesource.com/c/1278098 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
jchen10 cd47a379 2018-11-11T11:08:16 Add SH_INIT_SHARED_VARIABLES flag This option is used to initialize shared variables to zero at the beginning of shader execution to avoid compute shaders being able to read undefined values that could be coming from another webpage or application. It's implemented by declaring variables with initial value for HLSL. For GLSL, it's not allowed to use declaraction initializer for shared variables, so we need to explicitly assign them to zero at the beginning of main(). This implementation is only for HLSL. Bug: chromium:898030 Change-Id: Ic5906500bf4a35cd9a071923f82f32c5e2991be3 Reviewed-on: https://chromium-review.googlesource.com/c/1330310 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 48f63f90 2018-10-26T17:20:50 ES31: add row major matrix support (part 2) This patch implements read/write vector data in matrix or matrix data directly in a shader storage block with row_major qualifier. Bug: angleproject:1951 Change-Id: Id7847e2245b09414709361412a95c4dd84b9ee97 Reviewed-on: https://chromium-review.googlesource.com/c/1304019 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Qin Jiajia 5d2dfa46 2018-11-03T09:28:17 ES31: Add array of arrays support in SSBO Bug: angleproject:1951 Change-Id: I5e92b75a59a3ab24a34b827ae6f968961b8bea49 Reviewed-on: https://chromium-review.googlesource.com/c/1317376 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Austin Eng 1bf18ce9 2018-10-19T15:34:02 Implement GL_ANGLE_multi_draw This patch adds entrypoints glMultiDrawArraysANGLE, glMultiDrawElementsANGLE, glMultiDrawArraysInstancedANGLE, annd glMultiDrawElementsInstancedANGLE Bug: chromium:890539 Change-Id: Ic9c374c53892460f44ca6e73a253b78473ac2dff Reviewed-on: https://chromium-review.googlesource.com/c/1282268 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
Qin Jiajia a6e8a0c5 2018-11-02T15:11:50 ES31: Simplify IsInShaderStorageBlock function Bug: angleproject:1951 Change-Id: I0501502fa2201953a3dad4b18103ff5ae20db1bf Reviewed-on: https://chromium-review.googlesource.com/c/1314298 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yuly Novikov 5ca3e5a0 2018-10-31T11:13:29 Fix ShaderStorageBlockOutputHLSL::writeEOpIndexDirectOrIndirectOutput https://chromium-review.googlesource.com/c/1304017 removed str() wrapping values passed to TInfoSinkBase::operator<<(). This broke ANGLE roll https://chromium-review.googlesource.com/c/chromium/src/+/1309331 failing compile on linux-libfuzzer-asan-rel bot. Looks like libfuzzer compiler has a bug, not being able to find sh::BlockLayoutEncoder::BytesPerComponent. Wrapping it in str() works around this. Bug: angleproject:1951 Change-Id: I2deb573667dc1e88d352bad1933c269ec36cf398 Reviewed-on: https://chromium-review.googlesource.com/c/1309975 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Qin Jiajia d60e42f8 2018-10-25T16:33:16 ES31: add row major matrix support (part 1) This is the first patch to enable row major matrix suppot in series. This patch ensures that we can get correct location when we load/store data from matrix. Currently, only scalar data load/store works well. mat2x3 data The location of data[x][y] will be: data.offset + x * scalarStride + y * matrixStride //row_major data.offset + x * matrixStride + y * scalarStride //column_major Bug: angleproject:1951 Change-Id: I5bd7bad7d293219ba610f18eeafc56e70e36de43 Reviewed-on: https://chromium-review.googlesource.com/c/1304017 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Brandon Jones 4a22f4b0 2018-10-23T14:36:47 ES31: Add atomic_uint support to HLSL translator This is the first commit in a series to enable atomic counter buffers. Adds support for atomic counters to the GLSL->HLSL translator using RWByteAddressBuffer. Bug: angleproject:1729 Test: angle_end2end_tests Change-Id: I3b7e08f9256dc9bdbcc02ad8910040f2bc14aeac Reviewed-on: https://chromium-review.googlesource.com/c/1291329 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Qin Jiajia df73a8e5 2018-10-25T16:11:20 ES31: Use std::map<const TField *, BlockMemberInfo> to save ssbo info Bug: angleproject:1951 Change-Id: I9d6a19c0d63065db69985845a1cd68cfd4b99d1f Reviewed-on: https://chromium-review.googlesource.com/c/1298913 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Qin Jiajia 8edb7188 2018-10-10T15:54:23 ES31: Add structure field member support in SSBO This patch adds the structure field member support in SSBO. To support it, below things are done: 1. Calculate the offset and arrayStride in SSBO structure. 2. Support array of arrays translation. Bug: angleproject:1951 Change-Id: If8f233e6388d5bb905e78c39a85112d394298138 Reviewed-on: https://chromium-review.googlesource.com/c/1278097 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang fefaba5b 2018-10-26T16:16:53 Regenerate hashes for the builtin symbol table. BUG=chromium:890539 Change-Id: Ia5bdf652dc37a466560071b4fe2cdc7d89ff941f Reviewed-on: https://chromium-review.googlesource.com/c/1302837 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Austin Eng 7cf9cd24 2018-10-09T15:27:32 Add flags to shader translator to emulate gl_DrawID Adds support for translating gl_DrawID for implementation of GL_ANGLE_multi_draw. Currently the change only supports and allows emulation of the draw id using a uniform variable named `gl_DrawID`. This uniform is mapped in the translated shader to a hashed name that does not use the gl_ namespace Bug: chromium:890539 Change-Id: I08a246ca911e88e733ccdf22f1ed69dcae948e05 Reviewed-on: https://chromium-review.googlesource.com/c/1271957 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Till Rathmann b8543630 2018-10-02T19:46:14 Support GL_OES_texture_border_clamp Added support for GL_TEXTURE_BORDER_COLOR and GL_CLAMP_TO_BORDER in OpenGL/OpenGLES, Direct3D9 and Direct3D11 backends. For integer textures in OpenGLES3 contexts these additional entry points are available now: void glTexParameterIivOES(enum target, enum pname, const int *params); void glTexParameterIuivOES(enum target, enum pname, const uint *params); void glGetTexParameterIivOES(enum target, enum pname, int *params); void glGetTexParameterIuivOES(enum target, enum pname, uint *params); void glSamplerParameterIivOES(uint sampler, enum pname, const int *params); void glSamplerParameterIuivOES(uint sampler, enum pname, const uint *params); void glGetSamplerParameterIivOES(uint sampler, enum pname, int *params); void glGetSamplerParameterIuivOES(uint sampler, enum pname, uint *params); BUG=angleproject:2890 TEST=angle_end2end_tests.TextureBorderClamp* Change-Id: Iee3eeb399d8d7851b3b30694ad8f21a2111f5828 Reviewed-on: https://chromium-review.googlesource.com/c/1257824 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 672267fc 2018-10-19T17:01:17 ES31: Fix that asuint can't accept bool value This change fixes below errors: error X3013: 'asuint': no matching 1 parameter intrinsic function error X3013: Possible intrinsic functions are: error X3013: asuint(double, out uint x, out uint y) error X3013: asuint(float|half|int|uint) When we store a boolean value, we should cast it to uint firstly. Then do the store. Bug: angleproject:1951 Change-Id: I8931e540d701ef72bb82846496c698acef1ba1fb Reviewed-on: https://chromium-review.googlesource.com/c/1295831 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 19603b9e 2018-10-18T17:25:33 ES31: Allow function call, unary, ternary operators in SSBO When we meet function call, unary or ternary operator in SSBO access chain, we should transfer the process of them to OutputHLSL. Bug: angleproject:1951 Change-Id: I740940ac4eee4c5ed52239f14b1d32b1f9cf9385 Reviewed-on: https://chromium-review.googlesource.com/c/1290470 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Yizhou Jiang 7818a85c 2018-09-06T15:02:04 Implement GL_ANGLE_texture_multisample API part Support GL_ANGLE_texture_multisample extension. This patch adds enums of multisampled texture and texStorage2DMultisampleANGLE API. TEST=angle_end2end_tests.exe --gtest_filter=TextureMultisampleTest* TEST=angle_end2end_tests.exe --gtest_filter=NegativeTextureMultisampleTest.Negtive* BUG=angleproject:2275 Change-Id: I2cab997edc33aa2d0be6082381545335423f64e0 Reviewed-on: https://chromium-review.googlesource.com/c/804613 Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 64b7c4ff 2018-10-19T11:38:04 Use angle::Result in front-end (Part 3) Handles the gl::Framebuffer class and its implementation. Bug: angleproject:2491 Change-Id: I3b9c0609e9277264ccdb370596500562df3b7d15 Reviewed-on: https://chromium-review.googlesource.com/c/1280743 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 1d8a783c 2018-10-09T13:59:56 Re-land: "ES31: Add vector and matrix support in SSBO for D3D" Re-land skips ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11 to pass the bots. In fact, ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11 is not a regression. The reverted CL added more SSBO features and triggered the failure. To enable ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11, we should support SSBO in render pipeline. This needs to bind SSBO to UAV registers in link time instead of compile time since output variables also occupies the UAVs. Let's enable this test when we support SSBO in render pipeline. Currently, we shouldn't block the SSBO implementation in some common features. Bug: angleproject:1951 Change-Id: Ic339e8327e79335e6db1d86bedf0072635976f5f Reviewed-on: https://chromium-review.googlesource.com/c/1282277 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Jiawei Shao a1ac3fe8 2018-10-10T12:29:31 ES31: Support textureGather[Offset] on int/uint formats on D3D11 This patch implements the translation of textureGather[Offset] on integer and unsigned integer format textures on D3D11. According to MSDN, Gather[Red|Green|Blue|Alpha] can be used on integer and unsigned integer format textures with float texture coordinates: https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-to-gather Currently the dEQP tests on TextureGather[Offset] on cube map textures in integer or unsigned formats still cannot pass. This issue is under investigation. Bug: angleproject:2826 Test: dEQP-GLES31.functional.texture.gather.basic.2d.* dEQP-GLES31.functional.texture.gather.basic.2d_array.* dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d.* dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d_array.* dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.* dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.* Change-Id: If049dc395fb17cd34dec902630e3a1154e5d4806 Reviewed-on: https://chromium-review.googlesource.com/c/1271926 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c97e3f66 2018-10-12T15:49:06 Revert "ES31: Add vector and matrix support in SSBO for D3D" This reverts commit 671809e62e807eb0f890a5d53eee1f8cb5fb825e. Reason for revert: Regresses angle_end2end_test: ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11 Warning: compileToBinary(232): C:\fakepath(36,21-40): error X4509: UAV registers live in the same name space as outputs, so they must be bound to at least u1, manual bind to slot u0 failed The new test and this CL landed at nearly the same time. This CL breaks the test but it wasn't run on the CQ. Failure link: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Win10%20FYI%20Release%20%28NVIDIA%29/2717 Original change's description: > ES31: Add vector and matrix support in SSBO for D3D > > Bug: angleproject:1951 > > Change-Id: I19d4218b28770464e4cb38027cce694e2a817b5b > Reviewed-on: https://chromium-review.googlesource.com/c/1269827 > Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,cwallez@chromium.org,jiajia.qin@intel.com Change-Id: I54cda962e1361372f06e9e3bd667fa9c0ecf38dc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:1951 Reviewed-on: https://chromium-review.googlesource.com/c/1278102 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 671809e6 2018-10-09T13:59:56 ES31: Add vector and matrix support in SSBO for D3D Bug: angleproject:1951 Change-Id: I19d4218b28770464e4cb38027cce694e2a817b5b Reviewed-on: https://chromium-review.googlesource.com/c/1269827 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Qin Jiajia 3026f115 2018-10-09T12:13:38 ES31: Collect shader storage blocks info for d3d. This change collects shader storage blocks info for d3d backend. With this change, program interface APIs can get correct SSBO information for D3D. Bug: angleproject:1920 Change-Id: I6e2414494d0e8240bcb1d0ddc3d9a292eb7158ee Reviewed-on: https://chromium-review.googlesource.com/c/1269824 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Yizhou Jiang c4533eae 2018-09-19T15:23:29 Enable ANGLE_texture_multisample in glsl in es 3.0 Enable gsampler2dMS, texelFetch, textureSize in glslang in es 3.0 if ANGLE_texture_multisample is supported. Bug: angleproject:2275 TEST=SamplerMultisampleEXTTest.TextureMultisampleEXTEnabled Change-Id: Ibfa367970db3ae790f3822e57eb50090843dc6db Reviewed-on: https://chromium-review.googlesource.com/c/867521 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
Olli Etuaho 6f591c97 2018-09-21T11:20:47 Clean up TCompiler members and style Some dead code and duplicate data are cleaned up from the compiler. Several parameters can be accessed directly from ShBuiltInResources instead of creating a copy in TCompiler. This also encapsulates some TCompiler member functions as private and changes the remaining unprefixed TCompiler member variable names to start with the m prefix. BUG=angleproject:2068 TEST=angle_unittests Change-Id: I6690aaf538b17e0f45460660272a21f82f1808a0 Reviewed-on: https://chromium-review.googlesource.com/c/1267503 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Qin Jiajia 6d765b07 2018-09-28T14:16:06 ES31: Fix some bugs in ShaderStorageBlockOutputHLSL When EOpIndexDirect/EOpIndexIndirect/EOpIndexDirectStruct/TIntermSwizzle appear in [] in ssbo access chain, we should transfer the process of them to OutputHLSL. For example: instance.v[gl_GlobalInvocationID.x] = data; // becomes float_Store(dx_instance, 0 + 16 * gl_GlobalInvocationID.x, _data); instance.v[s.index[0].x] = data; // becomes float_Store(dx_instance, 0 + 16 * _s.index[0].x, _data); Bug: angleproject:1951 Change-Id: I333e238400a10a799a6294f8759cf9c4ef2451c8 Reviewed-on: https://chromium-review.googlesource.com/c/1250661 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Jiawei Shao 19b51d29 2018-09-19T15:14:45 ES31: Support textureGather[Offset] on shadow samplers This patch implements translating textureGather[Offset] into HLSL when the sampler is a shadow sampler. The related HLSL function should be GatherCmp(). According to the definition of textureGatherOffset(): ([ESSL 3.1] Chapter 8.9.3 Page 138) - gvec4 textureGatherOffset(gsampler2D sampler, vec2 P, ivec2 offset, [,int comp]) - vec4 textureGatherOffset(sampler2DShadow sampler, vec2 P, float refZ, ivec2 offset) We need to add parameter "refZ" before "offset" when the sampler is a shadow sampler. Bug: angleproject:2826 Test: dEQP-GLES31.functional.texture.gather.basic.2d.depth32f.* dEQP-GLES31.functional.texture.gather.basic.2d_array.depth32f.* dEQP-GLES31.functional.texture.gather.basic.cube.depth32f.* dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d.depth32f.* dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d_array.depth32f.* dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.depth32f.* dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.depth32f.* Change-Id: I9a7d095dd3cfa41aaefd14d012ed1f309abfc6d5 Reviewed-on: https://chromium-review.googlesource.com/c/1244081 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 5476e805 2018-10-05T13:23:03 Fix constructing void array zero nodes Correctly sized void arrays can be needed after parsing has recovered from an error and the code is trying to evaluate the constant value of a node. Since now we just have a generic EOpConstruct op instead of different ops for different types, we can simply remove the special handling for void arrays in CreateZeroNode to create the arrays in the correct size. BUG=chromium:890581 TEST=angle_unittests Change-Id: I48d96c9ef1d695cd8583a845fd4bd24a7aaf535c Reviewed-on: https://chromium-review.googlesource.com/c/1264515 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 0ca09753 2018-09-24T11:00:50 Add GLES3 support for EXT_blend_func_extended This adds GLES3 API support for EXT_blend_func_extended. The patch includes the API entrypoints, validation and also implementation on the desktop GL backend. Instead of having built-in fragment color variables, ESSL 3.00 has custom output variables, which can now be bound to either primary or secondary output color locations. The "index" set to a custom output variable determines whether it's used a primary or secondary blending source color. The shader layout qualifier takes precedence over the bind call. This is not specified in the EXT spec, but is specified in desktop OpenGL specs. BUG=angleproject:1085 TEST=angle_end2end_tests Change-Id: Ia24e8e5dadcc165e5e8fbd7c653c7fab6217db88 Reviewed-on: https://chromium-review.googlesource.com/c/1249361 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c3bef3e7 2018-10-03T07:35:09 Allow 'defined' in define in non-WebGL. This is needed to pass dEQP conformance. Several of the harder dEQP tests around this behaviour are excluded from the mustpass list. This is presumably because the behaviours weren't implemented portably. Nevertheless we need to support conformant behaviour for GLES 2.0 Contexts for the most simple uses. This also leaves the error behaviour intact for WebGL specs. Bug: angleproject:1335 Change-Id: Ia80b4f71475efa928488ee6c2ee35c566d4602d4 Reviewed-on: https://chromium-review.googlesource.com/c/1242013 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 1dfd8ae2 2018-10-01T15:59:59 Improve test coverage of constant folding Clean up some TODOs in the code as well as add tests to make sure that ANGLE treats expressions indexing into constant arrays as constant expressions in different contexts. This complements the existing tests in ConstantFoldingTest. BUG=angleproject:2298 TEST=angle_unittests Change-Id: I779bf03891f7d06f14d293e69101c05d7dbf57b6 Reviewed-on: https://chromium-review.googlesource.com/1254067 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho a78092cb 2018-09-26T14:16:13 Support ESSL 3.00 EXT_blend_func_extended shaders This adds support for the index layout qualifier that's used in EXT_blend_func_extended to set whether a fragment output should be bound to the primary or secondary blend source color. Output locations are now validated correctly so that two outputs can have the same location as long as they have a different index. Some tests are fixed to allow this. BUG=angleproject:1085 TEST=angle_unittests Change-Id: I1de3ad1406398952287791eca367562bed59d380 Reviewed-on: https://chromium-review.googlesource.com/1245982 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Qin Jiajia a602f906 2018-09-11T14:40:24 ES31: Support shader storage buffer in D3D-API side. Bug: angleproject:1951 Test: angle_end2end_tests Change-Id: I0d8a4f8cf00fc7fd2d85315138e2b7457fd0b90c Reviewed-on: https://chromium-review.googlesource.com/1242846 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiawei Shao cf8ad760 2018-09-21T09:11:35 ES31: Support translating textureGatherOffset into HLSL This patch implements the translation from GLSL texture function textureGatherOffset into HLSL by using the optional "offset" parameter of Texture2D.Gather[Red|Green|Blue|Alpha]. This patch also defines the implementation-dependent limit MIN_PROGRAM_TEXTURE_GATHER_OFFSET and MAX_PROGRAM_TEXTURE_GATHER_OFFSET on D3D11. According to MSDN, the valid range of "offset" used in Gather should be [-32, 31]. https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/gather4-po--sm5---asm- This patch also refactors OutputTextureGatherFunctionBody() so that some redundant code can be removed. BUG=angleproject:2826 TEST=dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d.rgba8.* dEQP-GLES31.functional.texture.gather.offset.min_required_offset.2d_array.rgba8.* dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d.rgba8.* dEQP-GLES31.functional.texture.gather.offset.implementation_offset.2d_array.rgba8.* (without texture_swizzle) Change-Id: Id0f411257b64c8a97428f16b1a86950ec6d36e2f Reviewed-on: https://chromium-review.googlesource.com/1237303 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Jamie Madill b36a4816 2018-09-25T10:15:11 Vulkan: Add OpenGL line segment rasterization. Line rasterization rules are implemented using a shader patch. The patch does a small test and discards pixels that are outside of the OpenGL line region. The feature is disabled on Android until we can determine the root cause of the test failures. Bug: angleproject:2598 Change-Id: Ic76c5e40fa3ceff7643e735e66f5a9050240c80b Reviewed-on: https://chromium-review.googlesource.com/1120153 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 74c179bb 2018-09-24T10:53:23 Vulkan: Refresh descriptor sets on driver uniform change. In some state change scenarios the driver uniforms would be updated but not reapplied to the current state. Fix this by setting the descriptor sets dirty when we dirty the driver uniforms. Includes a test using gl_DepthRange. Also fixes a bug with the upcoming line segment rasterization emulation. Bug: angleproject:2598 Bug: angleproject:2845 Change-Id: Ia66f3c86f9770ceb145069eec879fd8725111a76 Reviewed-on: https://chromium-review.googlesource.com/1240413 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Bryan Bernhart c55aefe3 2018-08-28T19:59:00 ES31: Support atomic functions on D3D11 - Part III This patch is the third one to support atomic functions on D3D11. In this patch we enable support for atomic function returns outside of assignments (e.g. part of arithmetic operations or to index into arrays) and when used directly initialize a variable. Note that we are still missing the functionality to be tag loops with [allow_uav_condition] as required by InterlockedCompareExchange. BUG=angleproject:2682 TEST=angle_end2end_tests Change-Id: Ia409ebb10621fd5c514cf6c76f366a320a9d9fc1 Reviewed-on: https://chromium-review.googlesource.com/1208317 Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jiawei Shao a977acc8 2018-09-19T12:46:05 ES31: Support translating textureGather into HLSL - Part I This patch is the first one in the series of supporting GLSL texture function textureGather/textureGatherOffset on D3D11. According to ESSL 3.1 SPEC (Chapter 8.9.3, Page 130), the definition of textureGather on sampler2D is: gvec4 textureGather (gsampler2D sampler, vec2 P[, int comp]) The parameter "comp" is optional, and if it is specified, the value of "comp" must be a constant integer expression with a value of 0, 1, 2, or 3, identifying the x, y, z, or w postswizzled component of the four-component vector lookup result for each texel, respectively. If comp is not specified, it is treated as 0. According to the definition above, textureGather is equivalent to Texture2D.Gather[Red|Green|Blue|Alpha] in HLSL, where we can use a switch-case expression to choose the right HLSL texture function. The features listed here will be implemented in the following patches: 1. Support textureGatherOffset 2. Support textureGather[Offset] on isamplers and usamplers 3. Support textureGather[Offset] on textures when swizzle is on 4. Support textureGather[Offset] on shadow samplers BUG=angleproject:2826 TEST=dEQP-GLES31.functional.texture.gather.basic.2d.rgba8.* dEQP-GLES31.functional.texture.gather.basic.cube.rgba8.* (without texture_swizzle) dEQP-GLES31.functional.texture.gather.basic.2d_array.rgba8.* (without texture_swizzle) Change-Id: Iff2ed4f8b65dad613cb0bafdfd19f8f0528e832c Reviewed-on: https://chromium-review.googlesource.com/1232980 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Qin Jiajia 017bda42 2018-09-14T18:11:50 Fix the ASSERT error This change adds shader type checking before entering initializeOutputVariables. BUG: angleproject:2821 Change-Id: Ib931031f2fc187f1f2a1821a09664bbe172a5e90 Reviewed-on: https://chromium-review.googlesource.com/1226229 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 2da04538 2018-08-24T13:59:44 Add sampler2DMSArray support to HLSL output This is done with small adjustments to TextureFunctionHLSL. Most of the functionality was already in place before. This changes the categorization of sampler types in BasicTypes.h helper functions: 2D array samplers are no longer treated as 2D samplers, but the two categories are now entirely disjoint. This makes TextureFunctionHLSL a little bit simpler. BUG=angleproject:2775 TEST=angle_unittests, angle_end2end_tests Change-Id: I84d9b56c37b1aaa01ee5921b6f17f8a78698fce2 Reviewed-on: https://chromium-review.googlesource.com/1188562 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 8e9d2340 2018-09-10T13:29:37 Vulkan: Fix FragCoord scaling when a viewport is applied. We were using the pivot based on the viewport dimensions which is only valid if the viewport is the size of the framebuffer. The more correct pivot size is actually based on the Framebuffer height. Also updates the driver uniforms block to be a bit simpler. Bug: angleproject:2598 Change-Id: I1cb500cded7141d10e8db6862b6ed29758cc7fb4 Reviewed-on: https://chromium-review.googlesource.com/1214205 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Qin Jiajia a735ee2f 2018-05-18T13:29:09 ES31: Support shader storage block in D3D11 compiler - Part1 This patch is the first step to implement a basic skeleton to translate shader storage block to HLSL RWByteAddressBuffer. In GLSL each shader storage block is just one structured block and in API side it corresponds to a buffer range where stores the whole structure. RWStructuredBuffer is an array-like object and can have many structured elements. The structured element doesn't support unsized array and also have a small limitation on the element size. So we choose RWByteAddressBuffer as the counterpart of shader storage block in HLSL. Due to RWByteAddressBuffer does not support using an index to reference a specific location, we must use Load and Store to process the read/write operation of a buffer variable. Moreover, in the compiler tree, since we can't use variable name to get the resource value in RWByteAddressBuffer, we have to calculate the offset of buffer variable in a shader storage block, then call the corresponding wrapper function to get the right value. In this patch, we only process below situations: assign_to_ssbo := ssbo_access_chain = expr_no_ssbo; assign_from_ssbo := lvalue_no_ssbo = ssbo_access_chain; The translation is like below: // GLSL #version 310 es layout(local_size_x=8) in; layout(std140, binding = 0) buffer blockA { float f[8]; } instanceA; layout(std140, binding = 1) buffer blockB { float f[8]; }; void main() { float data = instanceA.f[gl_LocalInvocationIndex]; f[gl_LocalInvocationIndex] = data; } // HLSL RWByteAddressBuffer _instanceA: register(u0); RWByteAddressBuffer _blockB: register(u1); float float_Load(RWByteAddressBuffer buffer, uint loc) { float result = asfloat(buffer.Load(loc)); return result; } void float_Store(RWByteAddressBuffer buffer, uint loc, float value) { buffer.Store(loc, asuint(value)); } void gl_main() { float _data = float_Load(_instanceA, 0 + 16 * gl_LocalInvocationIndex); float_Store(_blockB, 0 + 16 * gl_LocalInvocationIndex, _data); } We will do below things in the following patches: 1. Modify the intermediate tree to flatten all ssbo usages to: assign_to_ssbo := ssbo_access_chain = expr_no_ssbo; assign_from_ssbo := lvalue_no_ssbo = ssbo_access_chain; e.g. intanceA.a +=1; ->tmp = intanceA.a; intanceA.a = tmp + 1; while(++instanceA.a < 16) { } -> int PreIncrement(out int a) { a += 1; return a; } tmp = instanceA.a; while(PreIncrement(tmp) < 16) { instanceA.a = tmp } 2. Add offset calculation for structure and array of arrays. TODOs have been marked in the corresponding places in this patch. 3. Improve helper functions so that they can process all possible types. TODOs have been marked in the corresponding places in this patch. 4. Process the swizzle situation. TODOs have been marked in the corresponding places in this patch. A possible method is to extend current helper functions like below: *_Load(RWByteAddressBuffer buffer, uint loc, bool isSwizzle, uint4 swizzleOffset) Bug: angleproject:1951 Test: angle_end2end_tests Change-Id: I68ae68d5bb77d0d5627c8272627a7f689b8dc38b Reviewed-on: https://chromium-review.googlesource.com/848215 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Jamie Madill fb19e084 2018-09-06T15:39:09 Vulkan: Correct gl_FragCoord with default FBO. The viewport flipping we use would give incorrect values. Correct them using the same logic we do for gl_PointCoord. Also corrects the viewport scale driver uniform. It was not being updated after the draw framebuffer setting was adjusted. Also corrects the naming of the replaced builtin variables so it can't possibly conflict with a user variable. This was affecting the OpenGL line raster emulation. Bug: angleproject:2598 Change-Id: I843b5ac7b02160a5ec81a6f8ed2d937b0937198b Reviewed-on: https://chromium-review.googlesource.com/1208515 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho dff32a0d 2018-08-28T14:35:50 Support multisample arrays in shader programs The added tests check that using textureSize() and texelFetch() on textures with a fixed point format return expected results. texelFetch is also covered for integer format textures. dEQP GLES 3.1 tests also cover a variety of multisampled array texture formats. BUG=angleproject:2775 TEST=angle_end2end_tests, angle_deqp_gles31_tests Change-Id: I99b422e24b39e3563ed72f0fb85c9c1907df807d Reviewed-on: https://chromium-review.googlesource.com/1196521 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 70a4ef10 2018-08-30T15:55:41 Vulkan: Fix depth range scaling. We were using a formula that didn't work for some of the clipping tests. Bug: angleproject:2601 Change-Id: I60d965c2701656ad590c3b250c2cc777fb432421 Reviewed-on: https://chromium-review.googlesource.com/1194919 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho f0d0408a 2018-08-28T16:02:13 Use OES_texture_storage_multisample_2d_array There's an OES extension for multisample texture arrays, OES_texture_storage_multisample_2d_array. Change references from ANGLE_texture_multisample_array to the native extension in the shader compiler. ANGLE still needs to have robust behavior for out-of-range texel fetches that's not found in the original extension, but this does not need to be spelled out in the extension spec. BUG=angleproject:2775 TEST=angle_unittests Change-Id: Ie80ae767cc92ccaf7389af28789f45547f86978f Reviewed-on: https://chromium-review.googlesource.com/1193266 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 3e217f65 2018-08-28T16:55:20 Rename UniformHLSL to ResourcesHLSL In future, atomic counter and shader storage block will be added into UniformHLSL since they all need the UAV register. So this change renames UniformHLSL to ResourcesHLSL. Bug: angleproject:1951 Change-Id: Ie9eda090763fbb516468c138e65e111eb12fe514 Reviewed-on: https://chromium-review.googlesource.com/1193322 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 1e1b731a 2018-08-28T13:27:23 Vulkan: Clean up point coord translation. Use - 0.5 instead of + -0.5 in FlipGLPointCoord. Bug: angleproject:2673 Change-Id: I819dcc45f9098ea64085eb71af8920fe99b67c62 Reviewed-on: https://chromium-review.googlesource.com/1194454 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 8ca60805 2018-08-23T14:10:02 Add 2D MS array sampler support to compiler This also places textureSize(gsampler2DMS) correctly in the ESSL 3.10 builtins instead of ESSL 3.00 builtins. BUG=angleproject:2775 TEST=angle_unittests Change-Id: Ieb0f7a7424a5558a5569af6d4fcbcc9b12ec9840 Reviewed-on: https://chromium-review.googlesource.com/1186466 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiawei Shao 35bc74d6 2018-08-03T14:07:59 ES31: Support atomic functions on D3D11 - Part II This patch adds the support of translating atomicExchange and atomicCompSwap without return value on D3D11 back-ends. As the last parameter of the HLSL intrinsic functions InterlockedExchange and InterlockedCompareExchange is not optional, when there is a call of either atomicExchange or atomicCompSwap without return value, we add a temporary variable for it, so that we can directly translate all of such calls in outputHLSL.cpp. BUG=angleproject:2682 TEST=angle_end2end_tests Change-Id: I7e9c6d3c7d1846c865909b2f5a26592846c82582 Reviewed-on: https://chromium-review.googlesource.com/1161744 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Jiawei Shao 203b26f2 2018-07-25T10:30:43 ES31: Translate compute shader HLSL system variables in compile time This patch moves the implementation of translating compute shader builtin variables from link time to compile time. Unlike graphics shaders that require the information from other shader stages, we actually have enough information to translate compute shader builtin variables in compile time. Many redundant codes in DynamicHLSL have been removed after this refactor. BUG=angleproject:1442 Change-Id: I7458006785ff966a00a3825610adc5566652c75e Reviewed-on: https://chromium-review.googlesource.com/1149609 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Jamie Madill 76301e09 2018-07-19T11:48:30 Vulkan: Fix compound nested sampler struct params. Replace the struct type of binary and symbol parameter nodes with a lookup of the struct type in the tree. Bug: angleproject:2494 Change-Id: I1e892e0f1b1f97302d1cdce1035f51c01d0efd9e Reviewed-on: https://chromium-review.googlesource.com/1135695 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 06235df9 2018-07-20T14:26:07 Make HLSL shaders use only one main function Instead of having separate main() and gl_main() functions in HLSL shaders, add initializing outputs and inputs directly to the main function that's in the AST. This works around some HLSL bugs and should not introduce name conflicts inside main() since all the user-defined variables are prefixed. BUG=angleproject:2325 TEST=angle_end2end_tests Change-Id: I5b000c96aac8f321cefe50b6a893008498eac0d5 Reviewed-on: https://chromium-review.googlesource.com/1146647 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho da41ac69 2018-07-19T16:45:32 Fix decorating ViewID_OVR in HLSL output ViewID_OVR should not be decorated in HLSL output since it is an internal variable. Make sure that DecorateVariableIfNeeded() is used for varyings instead of just Decorate() so that the internalness is checked correctly and ViewID_OVR doesn't get decorated. This avoids possible name conflicts between the internal ViewID_OVR and any user-defined variables named ViewID_OVR. BUG=angleproject:2062 TEST=angle_end2end_tests, angle_unittests Change-Id: I9ed9876d4b2c760e7a11b0b270a2190993e840e5 Reviewed-on: https://chromium-review.googlesource.com/1143398 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Luc Ferron e835609c 2018-07-12T12:36:47 Vulkan: Implement gl_DepthRange support using driver uniform Bug: angleproject:2592 Change-Id: Iec3d111df4d8e5cef205c8afb177f0514ffac5c8 Reviewed-on: https://chromium-review.googlesource.com/1135448 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 1283ef62 2018-07-12T10:15:42 translator: Add TIntermPreprocessorDirective. This new node type can be used to inject preprocessor directives into the intermediate tree. Outputting the preprocessor directive is easy for the GLSL back-end. This can be used to implement workarounds such as the OpenGL line rasterization rules on Vulkan. Also fixes the build that was broken on Win/x64 with a prior change and makes more methods in IntermNode.h const. Bug: angleproject:2598 Change-Id: Ifd6d0ac7912ccf2137997bb9a0187fd063023d5e Reviewed-on: https://chromium-review.googlesource.com/1133420 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>