src/libANGLE/Shader.cpp


Log

Author Commit Date CI Message
Jamie Madill 847638a6 2015-11-20T13:01:41 Re-land "D3D: Generate more shader debug info by default." Re-land with fix for shader size query. The debug info can be very useful to WebGL developers. Instead of hiding the feature behind an unsupported and broken flag, always enable it so that WebGL devs can access the useful translated info. Change the debug info policy to build the full info (including generated assembly) in Debug, and all info excepth the assembly in Release. BUG=angleproject:1179 Change-Id: I812b2c9ba98cb8c9d5ec95721441c70e8990b626 Reviewed-on: https://chromium-review.googlesource.com/313600 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 55c25d0c 2015-11-18T13:08:08 D3D11: Fix varying packing with structs. Previously we would try to pass an entire struct through HLSL's shader interface. Instead, split this off as if each field was its own variable, which seems to be spec compliant (see ESSL 3.10). In the future we may want to fix register packing to use specific components of float4/int4/uint4 HLSL registers. This could also fix the remaining bugs in the SM3 packing. TEST=dEQP-GLES3.functional.shaders.linkage.varying.* BUG=angleproject:910 BUG=angleproject:1202 Change-Id: I1fd8b4505abc39bd2385ed5c088c316d55d0bc2c Reviewed-on: https://chromium-review.googlesource.com/311242 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9fc3682c 2015-11-18T13:08:07 D3D: Rework varying packing code. In D3D we pack varyings by making a register map, and using the recommended GLSL ES algorithm to reserve register space. We use this map to assign row and column slots to each varying and then produce a semantic index value. The existing scheme had a number of bugs, and was failing several angle_end2end_tests. The new design cleans up the code somewhat and uses a different counting scheme for the semantic indexes: just sort the varyings in packing order and use a simple incrementing semantic index per varying. In SM4+, the HLSL compiler sorts and packs the varyings correctly itself, and in SM3, handle the cases we don't support by returning an error instead of a D3D compiler link error. Also refactor how we store varying information for TF Feedback/ StreamOut. Only store the necessary D3D information, instead of extra information like the name and type. This fixes several tests in GLSLTest/*. This also will allow us to fix interpolation qualifier packing and the structure packing in HLSL, which seems to work differently than the rest of the varying types. BUG=angleproject:1202 TEST=bots,dEQP-GLES3.functional.transform_feedback.* Change-Id: Ie5bfbb4f71d8bf97f39115fc46d2e61b131df639 Reviewed-on: https://chromium-review.googlesource.com/311241 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill d2c52e3b 2015-10-14T17:07:05 Fix debug annotations and shaders. The Program refactor inadvertantly broken Debug annotations. Fix this by correctly passing the path to the temporary shader source in the first "C" string argument to ShCompile, instead of as the first part of the source string. BUG=angleproject:1177 TEST=manual testing with MSVS Change-Id: Ie77bb11b51645a474b542ddd2ae0f391e019e341 Reviewed-on: https://chromium-review.googlesource.com/306210 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 006cbc5b 2015-09-23T16:47:54 Remove rx::ShaderSh and move the shared code to the GL. The GL layer can interact with the translator directly, to query all the active shader variables and call ShCompile. BUG=angleproject:1159 Change-Id: I334a9bef28f93cf85dd8cac0fb8542ac567cc3ec Reviewed-on: https://chromium-review.googlesource.com/299877 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 91445bce 2015-09-23T16:47:53 Make a shader Shader::Data state structure. This design follows the similar designs for Program, Framebuffer, etc. Because of the current design, share a mutable pointer with the Impl so the patch becomes a bit smaller and easier to review. In a follow- up patch we can move the shared code into the GL layer. BUG=angleproject:1159 Change-Id: Ib243e74779f23be51cdca80f1b5c6e5f3e36059d Reviewed-on: https://chromium-review.googlesource.com/299876 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 046e53e3 2015-09-23T16:47:52 Add an interm ShaderSh class. This class logic will eventually move to the GL layer. Keep it in the Renderer layer for now for refactoring purposes. BUG=angleproject:1159 Change-Id: I91843099367f9a0293cc43ab98626bf79eb75ebf Reviewed-on: https://chromium-review.googlesource.com/299875 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a0a9e12d 2015-09-02T15:54:30 translator: Add sh::OutputVariable type. This replaces the dual-use of sh::Attribute, which can be a bit confusing to people expecting a literal output variable. Currently not used in Chromium, so should be safe to land. BUG=angleproject:1146 Change-Id: I436f2bc9dc4ddc3709369cb2baa344c6b13a21a2 Reviewed-on: https://chromium-review.googlesource.com/296683 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4cff2477 2015-08-21T16:53:18 Make PackedVarying a D3D-only type. The register assignment stuff only applies to the D3D back-end. Cleans up the GL back-ends use of PackedVarying, and will lead to future cleanups relating to packing varyings. BUG=angleproject:1123 Change-Id: Iaaa5fc03577e5b61ea6ae76ee1e15ad608037f34 Reviewed-on: https://chromium-review.googlesource.com/295190 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 80a6fc03 2015-08-21T16:53:16 Make output variables part of Program's shared data. Also initialize this structure within Program instead of DynamicHLSL. This should have benefits for other back-ends. Also these variables weren't being serialized and de-serialized with the program binary, which could mess up WebGL apps that use MRT. BUG=angleproject:1123 Change-Id: Ic0dd4840f26441a1bee8527dfa178b24daf82f8a Reviewed-on: https://chromium-review.googlesource.com/294571 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin 4d61f7ed 2015-08-12T10:56:50 Reland Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' Additional warnings found with more testing and added C4267 warning disable only for angle_libpng BUG=angleproject:1120 Change-Id: Ic403dcff5a8018056fa51a8c408e64207f3362eb Reviewed-on: https://chromium-review.googlesource.com/293028 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b195643c 2015-08-12T17:35:20 Revert "Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'" Seems to have quite a few warnings in 64-bit on my machine. BUG=angleproject:1120 This reverts commit c5cf9bc47d0ee028adbbf9e9f94ca567eec601dc. Change-Id: I86768b900aeba52e7a2242d9ae8949f93f1a5ba9 Reviewed-on: https://chromium-review.googlesource.com/293280 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin c5cf9bc4 2015-08-06T10:46:48 Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' BUG=angleproject:1120 Change-Id: I01ef10bea7f487c2b394d030c76628f38d2ea645 Reviewed-on: https://chromium-review.googlesource.com/292780 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez bc99bb6b 2015-05-14T17:42:20 Enable more warnings on GCC and clang BUG=angleproject:892 Change-Id: I74ca341f29b245f698d1e1ad43149a91db46817f Reviewed-on: https://chromium-review.googlesource.com/271411 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 492a7e43 2014-11-05T13:27:06 Encapulate the ESSL compiler into a GL object that is per-context. * Allows for multiple contexts have to have different client versions, caps and extensions without causing shader compilation failures. BUG=angle:823 Change-Id: I523679e90be031b0b7fa385d46d6839b1cf3029f Reviewed-on: https://chromium-review.googlesource.com/227710 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 437d2662 2014-12-05T14:23:35 Move some D3D-specific stuff into ProgramD3D. BUG=angle:773 Change-Id: I48b42e7a3e82a43d3dde16a8d1016d28280eae39 Reviewed-on: https://chromium-review.googlesource.com/232968 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e7cfb3dd 2014-12-03T10:58:56 Do not use std::strlen. GCC doesn't use the std:: namespace for these methods. BUG=angle:773 Change-Id: I0d887f103298cdd184b3f7825c5e44363edb9b92 Reviewed-on: https://chromium-review.googlesource.com/232697 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Geoff Lang f60fab6d 2014-11-24T11:21:20 Fix handling of shader source with fixed length. BUG=angle:837 Change-Id: Ie9c3059ad2973b0733be92b7548525ee694bb1fa Reviewed-on: https://chromium-review.googlesource.com/231612 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2b5420c0 2014-11-19T14:20:15 Merge libGLESv2 and libEGL classes into libANGLE. BUG=angle:733 Change-Id: Ic491c971411fe82c56cd97c5c8325ac14ec218df Reviewed-on: https://chromium-review.googlesource.com/230830 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>