src/common


Log

Author Commit Date CI Message
Jacek Caban a5521de2 2014-10-01T17:23:46 Fixed mingw compilation. Change-Id: I8ae33c752feb19e291e4a3b128d21a0ced883c90 Reviewed-on: https://chromium-review.googlesource.com/220761 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill b4fd0c96 2014-10-01T17:40:24 Replace usages of std::vector::data in most cases. In some parts of ANGLE code, we were using std::vector::data to get a pointer to the first element. Sadly, this is c++11 only, which isn't currently supported on Chromium. This was causing a breakage on Android. We should probably refrain from using data except on D3D-only code, which we know will be Visual Studio. BUG=angle:767 Change-Id: Ibc10577368435a13f62d74d77c95076482cd8f82 Reviewed-on: https://chromium-review.googlesource.com/220920 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b60fe31f 2014-09-26T14:56:41 Fix the ANGLE_ENABLE_TRACE build. We needed to include angleutils.cpp in libtranslator for this to compile. Also allow the event helpers to record API calls even if ANGLE_ENABLE_PERF is off. BUG=angle:513 Change-Id: I2646d5ebeae536a4a7f1cd7ecaf0ce019ce5ff76 Reviewed-on: https://chromium-review.googlesource.com/219756 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Cooper Partin eeb1f537 2014-09-23T10:25:02 Added SurfaceHost to enable additional hosts and abstract access for EGLNativeWindowType. Change-Id: I590b52925c6b9127d08eaf0e5ba2a0bde30505c3 Reviewed-on: https://chromium-review.googlesource.com/219488 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Shannon Woods 950cb606 2014-09-18T10:01:56 Create test configuration include guards BUG=angle:501 Change-Id: I0281cf6de4fbf8ddd142b7af4ea2917f0a0a1569 Reviewed-on: https://chromium-review.googlesource.com/218840 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill cc00239d 2014-09-09T10:21:56 Revert "Optimize dynamic buffers." This reverts commit 3e3813f787ee5e8bb7808eed539a606a4e2e3fd3. Conflicts: src/libGLESv2/renderer/d3d/d3d11/Buffer11.cpp Change-Id: I6470059672d3b377ce0fafbc8b637318a91f62c8 Reviewed-on: https://chromium-review.googlesource.com/217106 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shannon Woods 8e7d7a30 2014-09-02T17:09:08 Fix use of references with va_start BUG=angle:736 va_start behavior is undefined if the second parameter is a function, array, or reference type. clang produces a warning for this, while MSVC does not. Change-Id: I0bc2805e312e3542aac816f10a257e2f1cfad128 Reviewed-on: https://chromium-review.googlesource.com/216010 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Tested-by: Nico Weber <thakis@chromium.org>
Jamie Madill 33ea2f97 2014-08-29T15:15:01 Added BufferSubData benchmark. BUG=angle:705 Change-Id: I65d557f35e4c9f1d94853a775330a92b7d428847 Reviewed-on: https://chromium-review.googlesource.com/213810 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0b7eef7c 2014-06-12T14:10:47 Removed common_includes.h reordered includes. Since we are not using precompiled headers anymore, remove common_includes.h so that fewer files are included in cpp files. Reordered includes to be in the following order: 1) Local ANGLE project headers, ordered by directory in descending depth 2) GL headers 3) STL headers This helps enforce the include-what-you-use principal by reducing the number of STL headers unexpectedly shared between files. This include order conflicts with some of the Google c++ style guide which states that STL includes should be first but this helps us catch more issues. Change-Id: I8f7785f4ad574e253dd3c7b4fb1e54d3ce3b99fc Reviewed-on: https://chromium-review.googlesource.com/214850 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill a6f267f9 2014-08-27T11:44:15 Fix row-major layout tracking in interface blocks. Some block field types, such as nested structs, were bugged. This only affects our "CollectVariables" path, not our current HLSL UBO path. BUG=angle:466 Change-Id: I2b8daf58aa7ec1ad06a80d38f57e76087eacccdc Reviewed-on: https://chromium-review.googlesource.com/213503 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 42bcf32e 2014-08-25T16:20:46 Refactor ShaderVariables to store fields in the base. Instead of only storing structure information in Varyings, Uniforms and Interface Block Fields, store it in the base class. Also only store base variable information for struct fields, instead of fully typed information. This works because stuff like interpolation type, invariance, and other properties are for the entire variable, not individual fields. Also add new fields for interface block instance name, varying invariance and structure name for all struct types. BUG=angle:466 Change-Id: If03fc071e6becb7aad6dea5093989bba7daee69e Reviewed-on: https://chromium-review.googlesource.com/213501 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 3e3813f7 2014-08-25T13:58:16 Optimize dynamic buffers. In D3D11, we would previously always use a staging buffer to proxy data to the GPU. This change allows users which specify DYNAMIC_DRAW to skip the staging buffer as long as they only write to index or vertex buffers. This improves performance on all tested GPU vendors, but in D3D11 on AMD and Intel our SubData calls are still significantly slower than in D3D9. BUG=angle:705 BUG=365078 Change-Id: I4f83164176d67ff00119bdd0a6a80d7c84fd0f03 Reviewed-on: https://chromium-review.googlesource.com/213813 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang da5777cf 2014-07-11T09:52:58 Create an Error object to represent GL errors. BUG=angle:520 Change-Id: I1a54e6f308b5b0f310c725a7771af737a77ecd42 Reviewed-on: https://chromium-review.googlesource.com/209619 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 39b43463 2014-08-18T16:39:50 Use Range type for index ranges. This compacts a lot of parameter passing. Refactoring patch only. BUG=angle:571 Change-Id: Ic918478d0c6b81093bfea6154ce0f6bf1d2b5be2 Reviewed-on: https://chromium-review.googlesource.com/210645 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill a2ad4e8a 2014-07-17T14:16:32 Export shader variables from the translator DLL. This will allow us to use these methods when compiling the translator as a DLL. BUG=angle:466,697 Change-Id: Ic9169fb7c69fe0bf5f98addfc128a30ee6b2159d Reviewed-on: https://chromium-review.googlesource.com/208752 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill aff8084b 2014-08-04T10:47:56 Fix VertexBuffer11::getSpaceRequired for instanced attribs. The computation could copy more data than needed. Although benign it could cause performance degredation compared to the D3D9 back end. Change-Id: I3cf1dc79085c33d44040fd55153e63a4e5e63cb1 Reviewed-on: https://chromium-review.googlesource.com/210640 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill e294bb87 2014-07-17T14:16:26 Add new shader inspection APIs. Each new entry point corresponds to one of the variable types: varyings, attributes, uniforms, output variables, and interface blocks. They return a pointer to the vector with all of the parsed variables, which then the app can copy to its own memory. Currently we do not support the staticUse field in the HLSL translator. BUG=angle:466 Change-Id: I7dc09e761ab070feef5360ad27740110c44853b3 Reviewed-on: https://chromium-review.googlesource.com/208750 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 13cfd276 2014-07-17T14:16:28 Move shader variables header to include folder. This allows the API to query for clear type introspection into the parsed GL types from the translator. The returned types are not expanded and have properly nested fields. This patch uses the types from ShaderVars.h to return GL type information. The app must include this header to get access to the types structs. BUG=angle:466 Change-Id: I28ad0d6f11a964804dd234ef0d00651f665d1ae3 Reviewed-on: https://chromium-review.googlesource.com/208751 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill 6a72979f 2014-07-18T10:33:14 Move shadervars constructors to cpp files. This avoid unnecessary binary bloat from STL default constructors and assignment operators. BUG=angle:466,697 Change-Id: I679e524d3e3dbd0d3866fc30a5a01967d8769249 Reviewed-on: https://chromium-review.googlesource.com/208356 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: bratell at Opera <bratell@opera.com> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill a3fe2b4e 2014-07-18T10:33:13 Update non-default constructors in shadervars.h. Most of these constructors are unused. Remove the unused ones, and change the usage of existing constructors to be consistent. BUG=angle:466,697 Change-Id: I455dd314036e1dfcb8c4690bab577b81dd0e060c Reviewed-on: https://chromium-review.googlesource.com/208355 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Geoff Lang bfdea66b 2014-07-23T14:16:32 Remove try-catch blocks from entry points. BUG=angle:700 Change-Id: I036901c397053a75677923304d7e1ed697c82aa2 Reviewed-on: https://chromium-review.googlesource.com/209570 Reviewed-by: <ehsan@mozilla.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e04a5b7b 2014-07-18T10:33:12 Remove sh::InterfaceBlock member info. We can compute the interface block member info entirely on the API side. This will allow us to get rid of some un-necessary code in the compiler. BUG=angle:466 Change-Id: I664ffc82de5f2723156e51f4e9ffc07e4de162aa Reviewed-on: https://chromium-review.googlesource.com/207781 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 28f70c3a 2014-07-18T10:33:10 Remove sh::Uniform::registerIndex and elementIndex. With the previous cleanups, these fields aren't needed any longer. We can also clean up some unused methods and simplify existing code. BUG=angle:466 Change-Id: I96df8d152324bda5e6868b5eccdf52bdc09155e9 Reviewed-on: https://chromium-review.googlesource.com/207256 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill bf9cce2e 2014-07-18T10:33:09 Use the block encoder class to store uniform offsets. This will allow us to use the same code path for assigning register information in all places. Because of this it fixes some long-broken dEQP struct uniform tests. BUG=angle:466 BUG=angle:505 Change-Id: I4161a388503aa09bbe2d21ff47bfb3352ec93881 Reviewed-on: https://chromium-review.googlesource.com/207255 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill fc43d273 2014-07-11T17:02:02 Remove the sh::InterfaceBlock::dataSize member. We can replace this by doing the same calculation in the HLSL-side code. BUG=angle:466 Change-Id: Iecae4a92e9037e851419ce73e6267094ee8071a2 Reviewed-on: https://chromium-review.googlesource.com/207251 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill d4116ff3 2014-07-11T17:02:01 Remove sh::InterfaceBlock::registerIndex. This value is HLSL-only and we can use the new query API to hide it from GLSL programs. BUG=angle:466 Change-Id: I75dc2fbbf1b29b1f6d561568174a15dea1f5b130 Reviewed-on: https://chromium-review.googlesource.com/207250 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill 829e89ef 2014-07-10T17:50:09 Add a default constructor to sh::ShaderVariable. This cleans up a few repeated lines of code in shadervars.h. BUG=angle:466 Change-Id: Ie77130e8420d28df790bf9bc036d52fd053b3ce9 Reviewed-on: https://chromium-review.googlesource.com/206827 Reviewed-by: Nicolas Capens <capn@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill d5512cd4 2014-07-10T17:50:08 Collect shader outputs and interface block information. This paves the way for returning ES3-specific info from the shader translator with the new query methods. BUG=angle:466 Change-Id: Ib13cdb604854cdf11e9dc00dd94f18eadc946561 Reviewed-on: https://chromium-review.googlesource.com/206770 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill 77f74853 2014-07-08T15:02:34 Add a GetVariableInfo helper method. This method replaces the similar logic in storing uniforms, varyings, and interface blocks when collecting variable info. We can also re-use this method for both GLSL and HLSL programs. BUG=angle:466 Change-Id: Ie6c13abe0f09f38b2f9b36e117caae4833eaccbf Reviewed-on: https://chromium-review.googlesource.com/206566 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 93455ebe 2014-07-08T15:22:50 Add missing limits include to angleutils.h This missing include was breaking the build on Linux. BUG=angle:692 Change-Id: Id502f477d6e3373519b011e75c144782e9101944 Reviewed-on: https://chromium-review.googlesource.com/206633 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 53cb14dc 2014-07-08T15:02:35 Share ArrayString and Str helper methods. Placing these string helper methods allows us to re-use them in the relevant place of the shader translator. BUG=angle:466 Change-Id: Idd638542027d3b1035bc79fc941e80bf436c82af Reviewed-on: https://chromium-review.googlesource.com/206567 Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Ehsan Akhgari 10530c34 2014-07-02T20:37:53 Add ANGLE_NO_EXCEPTIONS macro This macro allows us to hide angle's usage of try/catch so that we can properly hide them from compilers that do not support exceptions properly (such as clang-cl and gcc/clang with -fno-exceptions). Change-Id: I75f466a5322e5840e007711ea851f444bd6ca299 Reviewed-on: https://chromium-review.googlesource.com/206562 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: <ehsan@mozilla.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ehsan Akhgari c1cc4c46 2014-07-02T13:09:07 Support building angle with clang-cl This works around http://llvm.org/PR20013. Change-Id: Ibbd8ab4678cf1caf39b329ea304bdbdc21075ddf Reviewed-on: https://chromium-review.googlesource.com/206481 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: <ehsan@mozilla.com>
Jamie Madill 5079c880 2014-07-03T14:13:58 Fix GCC warning about initialization order. Shifting these fields was breaking the build in Linux GCC. BUG=angle:690 Change-Id: I34286753f7ab636900f25f880187dbb297e9c040 Reviewed-on: https://chromium-review.googlesource.com/206632 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill a718c1e0 2014-07-02T15:31:22 Use shader variable types for variable collection. Retire the old TVariableInfoList structure, and use the new objects which we will expose more directly through the API. BUG=angle:466 Change-Id: I999a97369bfb67cf73cd659c4fe885b41429d304 Reviewed-on: https://chromium-review.googlesource.com/205839 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 865d1451 2014-07-02T15:31:20 Consolidate varying packing sort order methods. We were using the same list in the shader varying sorting as well as in the varying packing validation in the translator. BUG=angle:466 Change-Id: Ic11758288e7a522d7c18a293de9e137e487e3978 Reviewed-on: https://chromium-review.googlesource.com/205595 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill aa72d782 2014-07-02T15:31:19 Remove duplicate SH and GL functions. In several places we were using variable query methods that were duplicated between the old SH enums and the corresponding GL enums. We can use the common GL enum versions now. BUG=angle:466 Change-Id: Ib8797fe6bc75828e05aed37b1f5fbd4b9ba03d22 Reviewed-on: https://chromium-review.googlesource.com/205594 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill 183bde55 2014-07-02T15:31:19 Return shader variable information using GLenum values. Instead of duplicating GL header define values, explictly return GLenum for variable queries in the shader inspection API. This reduces the duplicate defines in the shader compiler header. BUG=angle:466 Change-Id: Iddaaff597b188251fa2e546f352bf77ab3ac43bc Reviewed-on: https://chromium-review.googlesource.com/205860 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <capn@chromium.org>
Jamie Madill ce505553 2014-06-26T14:56:33 Revert "Return variable type queries using GLenum values." Breaks the FYI bots until we get Chromium patched. BUG=angle:466 This reverts commit 53221f5a0382887155d90f7f286e41190d4f5bfb. Change-Id: Ib28548df5c10a6f76f46e4cf8f2013dca5cf0ee2 Reviewed-on: https://chromium-review.googlesource.com/205850 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 53221f5a 2014-06-25T16:04:59 Return variable type queries using GLenum values. Instead of duplicating GL header define values, explictly return GLenum for variable queries in the shader inspection API. This reduces the duplicate defines in the shader compiler header. BUG=angle:466 Change-Id: If631b20ce68747297a946e1371def7709027a613 Reviewed-on: https://chromium-review.googlesource.com/204937 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill f51639a4 2014-06-25T16:04:57 Use a common include for GL headers. A common place to define required GL includes gives us a nice point to centralize GL customizations. In the header currently are the basic GLES headers with extensions, and a define carried over from desktop GL. BUG=angle:466 Change-Id: I6fc61947b4514654ec21355a786904eac04656c0 Reviewed-on: https://chromium-review.googlesource.com/204936 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Jamie Madill f2575989 2014-06-25T16:04:54 Use the sh namespace for shader variables. Since these types originate from the translator, use an appropriate namespace. Also rename some of the gl helper functions to be more specific to their functionality. BUG=angle:466 Change-Id: Idc29987b2053b3c40748dd46b581f3dbd8a6fd61 Reviewed-on: https://chromium-review.googlesource.com/204680 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill bb94f341 2014-06-23T15:23:02 Remove gl::IsInternalTextureTarget. This function was a duplicate of ValidTexture2DDestinationTarget. Also clean up a bit of the code in Framebuffer::completeness. BUG=angle:660 Change-Id: Iee8d011274bfb2e426346e3ccdde7342fbb7ef44 Reviewed-on: https://chromium-review.googlesource.com/202595 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e261b44a 2014-06-25T12:42:21 Remove obsolete Renderbuffer types. RenderbufferProxySet and FramebufferTextureBindingPointer aren't necessary any more with our refactored renderbuffer classes and ownership of attachments by the Framebuffer. We can also consolidate the FramebufferAttachment and implementation to a single class, and no longer need to store ref counted objects in the Framebuffer class directly. BUG=angle:660 Change-Id: Idcc06dfb42b47242b33494e797a0ba06d6669511 Reviewed-on: https://chromium-review.googlesource.com/201838 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill f91ce811 2014-06-13T10:04:34 Split OutputHLSL uniform code into new module. Refactoring patch only, should have no externally visible changes. BUG=angle:466 Change-Id: I01088a3b2979b96702d0a3c424d26928eb72b5b2 Reviewed-on: https://chromium-review.googlesource.com/203731 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill bae30a00 2014-06-17T10:45:02 Add a macro for unused trace variables. This fixes the standalone 64-bit Debug build. Change-Id: I348b71a96ada435867367e565bc84b570d2bfb67 Reviewed-on: https://chromium-review.googlesource.com/204292 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Shannon Woods 3dc8020a 2014-06-16T13:29:52 Fix dependent typename build error on non-MSVC compilers BUG=angle:677 Change-Id: Ic0d257ef41e8c80baeddd664eb6c2cc5db94ee43 Reviewed-on: https://chromium-review.googlesource.com/203428 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Shannon Woods fb839475 2014-06-16T13:21:41 Fix ifdef complaints in clang BUG=angle:677 Change-Id: Iee457dfc0990e5ffd61932b1f286f3c0208568bc Reviewed-on: https://chromium-review.googlesource.com/203427 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Geoff Lang 04fb89ad 2014-06-09T15:05:36 Generate pixel shader output to match the bound framebuffer. Only generate pixel shader output variables for render targets that are currently bound. Fixes some performance issues with D3D10 cards that were slow to discard unused outputs. Fixed memory leaks in ProgramBinary by refactoring the freeing of the current state into a reset function. BUG=angle:670 Change-Id: I40f83e15724fb9a1a9ae61363a056999f1fa26d2 Reviewed-on: https://chromium-review.googlesource.com/202977 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang cec3590a 2014-04-16T10:52:36 Use a Caps structure to store extension and texture format support. Removes support for fallbacks in D3D9 texture formats. The fallback formats did not work properly anyways. BUG=angle:658 Change-Id: Idfa5183bf71fd8ebf4608f940f9d93177b9eff08 Reviewed-on: https://chromium-review.googlesource.com/200813 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9c4b24a5 2014-06-12T13:41:17 Use commit_id.py on Windows, and handle missing git. This allows us to delete the Windows batch file. Changes the commit_id script to take the working directory so that it can be called from a different working directory than the angle repository is in. Renames the generated commit header to angle_commit.h. This is being written to the shared generated code directory for the entire build, and "commit.h" is insufficiently unique. BUG=angle:669 Change-Id: I35e80411a7e8ba1e02ce3f6a4fc54ed4dbc918f3 Reviewed-on: https://chromium-review.googlesource.com/202048 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 44fa7594 2014-05-30T11:50:07 Refactor platform related functionality into platform.h and tls.h. Since libGLESv2 and libEGL will eventually be cross platform, it will be useful to have platform defines and TLS functions that work everywhere. BUG=angle:664 Change-Id: Ia357925a0992d82e8b446d88d32a1984d319e6e8 Reviewed-on: https://chromium-review.googlesource.com/202133 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang d7e7d735 2014-05-27T16:10:46 Move the GL_APICALL and similar defines to the project level. BUG=angle:658 Change-Id: Ib4fa10bb89a6658efbc20d5a763d8ec9c3a5506f Reviewed-on: https://chromium-review.googlesource.com/201465 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 9cd1915c 2014-05-28T15:54:34 Fix warnings about unreferenced local variables. BUG=skia:2272 Change-Id: Ibf03efedc662fea2a389ad2dc5af5b7b014181a8 Reviewed-on: https://chromium-review.googlesource.com/201900 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Vladimir Vukicevic 24d8d675 2014-05-27T12:07:51 Fix register packing for structs in d3d9. Fixes WebGL test misc/shader-with-array-of-structs-uniform BUG=angle:656 Change-Id: If79a19db4d40bab9110422f7876de32e7f85e506 Reviewed-on: https://chromium-review.googlesource.com/200620 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org>
Jamie Madill c600c8c3 2014-05-16T11:22:21 Fix arrays-of-struct and nested struct uniforms. Our computation of register offsets had a few errors that messed up nested structs and arrays of structs. This fixes a WebGL test, as well as several dEQP tests. BUG=angle:505 TEST=WebGL CTS 1.0.3, dEQP-GELS3.functional.uniform-api Change-Id: Id5a0f39481e079fe5ef5ef856943dc1f91ee3639 Reviewed-on: https://chromium-review.googlesource.com/200045 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1b2a8f96 2014-05-14T13:09:39 Fix binary serialization to use explicit size and type. Loading program binaries across different architectures would cause runtime errors due to use of size_t. Also fix the ANGLE major and minor version that were clobbered in an earlier commit. BUG=angle:647 BUG=371435 Change-Id: I9473cc7e119592fce336aa47881839543e337b69 Reviewed-on: https://chromium-review.googlesource.com/199633 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill ff0d2ba6 2014-05-14T13:49:10 Split register allocation of varyings from the translator. The translator gl::Varying struct does not need to know about register allocation. We can put that entirely in the API library. This makes exposing Varying variables with the new translator types cleaner. BUG=angle:466 Change-Id: Ib85ac27de003913a01f76d5f4dc52454530859e6 Reviewed-on: https://chromium-review.googlesource.com/199736 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4f8fcc24 2014-05-14T13:49:09 Remove gl::Varying::elementIndex. We only assigned to elementIndex, and never referenced the value at any point in our code. BUG=angle:466 Change-Id: I541a353110bcd1863b07b21bcf21fad38be19ca1 Reviewed-on: https://chromium-review.googlesource.com/199735 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 11c3b30f 2014-05-13T22:33:31 Revert "Fix binary serialization to use explicit size and type." This reverts commit 261988513e89479a0d121d045a8d89b64dc68214. Change-Id: I959ca14fcbb257f12005f7f0b64a600e906a118c Reviewed-on: https://chromium-review.googlesource.com/199630 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Jamie Madill 26198851 2014-05-12T15:49:38 Fix binary serialization to use explicit size and type. Loading program binaries across different architectures would cause runtime errors due to use of size_t. Also fix the ANGLE major and minor version that were clobbered in an earlier commit. BUG=angle:647 BUG=371435 Change-Id: If2ad4c8fc246cc9ff0b4d95ba87b7d1ed109a064 Reviewed-on: https://chromium-review.googlesource.com/199102 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 07d68856 2014-05-06T16:31:14 Move the implementations of shader var init to the header. Making the contructors for shader variables inline saves us from exporting them across DLL boundaries. This makes it easier to use them in the translator when building the translator as a DLL. BUG=angle:466 Change-Id: Iee0556e06dc1f9e98fe9eea6577819305de0dd0b Reviewed-on: https://chromium-review.googlesource.com/198555 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang cc14f104 2014-05-05T17:00:40 Use a static function instead of a static initializer for defaultBlockInfo. BUG=angle:640 Change-Id: I5fe568c9a2b492a5bd8a42142762229c5f992c7e Reviewed-on: https://chromium-review.googlesource.com/198248 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 9fba2ba0 2014-04-22T14:21:00 Fix GCC Release build. The release build was complaining about a missing size_t definition in blocklayout.h. BUG=angle:568 Change-Id: I9757f3ac45627a2a73d4f90cc507f8620674820e Reviewed-on: https://chromium-review.googlesource.com/196290 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4f267868 2014-04-17T15:53:37 Fix Linux build. We were missing several header includes necessary for GCC. Also our static assert macro had a bug, preventing us from using the same assert in multiple places. BUG=angle:568 Change-Id: I01bcdef033a9380f436cbf4bd2a9f11b1553887c Reviewed-on: https://chromium-review.googlesource.com/195471 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 834e8b77 2014-04-11T13:33:58 Move ShaderVariables to common shared source. Also move the block layout encoding utilities to the common folder. The combined changes allow us to include the shader and block code into both libGLESv2 and the translator separately. This in turn fixes the Chromium component build, where we were calling internal translator functions directly from libGLESv2. BUG=angle:568 Change-Id: Ibcfa2c936a7c737ad515c10bd24061ff39ee5747 Reviewed-on: https://chromium-review.googlesource.com/192891 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 70656a64 2014-03-05T15:01:26 Implement queries and enums for buffer mapping. GetBufferPointerv, GetBufferParameteri64v, and new values for GetBufferParameteriv. BUG=angle:565 Change-Id: I179a3193987b2bff1b0628e47f6a0d627541b0cf Reviewed-on: https://chromium-review.googlesource.com/188203 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 2515c520 2014-03-07T10:28:43 Fix compile errors on pre-C++11 compilers. BUG=angle:575 Change-Id: Ibad77fda193c850c29483aa56d0d2275c131429a Reviewed-on: https://chromium-review.googlesource.com/189163 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang feee44bf 2014-03-05T11:34:31 Keep the debug log file open and flush with each message. Instead of opening and closing the debug log file with each message, keep it open permanently and flush it with each message, allowing the OS to flush to disk as needed. With debug logging enabled, performance is improved by 100x! Also, dynamically size the output buffer to the max message size. When running all the samples, the largest debug message was 318 characters so an initial size of 512 (instead of 32768) seems reasonable. BUG=angle:575 Change-Id: If4a1387431fc2d32a6b2d1f9ca1f2590473feb86 Reviewed-on: https://chromium-review.googlesource.com/188713 Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0aa84f63 2014-02-13T13:17:23 Merge 'Tie program binary version to commit hash.' Port changes from master branch with commit hash embedding to the development branch. BUG=angle:529 Change-Id: I307bf44103913aaaeb875a2e3ade1fab77838c48 Reviewed-on: https://chromium-review.googlesource.com/186390 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7ab02faf 2014-02-04T16:04:08 Add D3D11 vertex format tables to our format utils. Moving the vertex format information to a globally accessible helper file makes them available for the dynamic shaders logic. Change-Id: I67d6280c0603d9c601ca504751c8905677c2426f Reviewed-on: https://chromium-review.googlesource.com/184399 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 83217796 2014-01-16T09:52:38 Remove system.h. The gyp files already define NOMINMAX and WIN32_LEAN_AND_MEAN. windows.h is also included via the D3D includes. This ends up speeding up the build process significantly by not having windows.h included in nearly every file. Also fixes issues on non-windows systems by not having stdarg.h included in debug.cpp. Change-Id: Id32d9aac37a5a29df832a062dd8024302a798a1c Reviewed-on: https://chromium-review.googlesource.com/183251 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 92bfd5c6 2014-01-16T13:51:35 Remove __stdcall from non-windows builds. Change-Id: I424cb538808ec64137c85af3bbe8742043e1c573 Reviewed-on: https://chromium-review.googlesource.com/183260 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang f5713124 2013-10-07T17:06:30 Rework tracing and perf defines. Changed ANGLE_DISABLE_* to ANGLE_ENABLE_* for perf and tracing defines so they are disabled by default. Updated the gyp files to only turn on perf by default for windows debug builds. Change-Id: I71706674e6d12fbf4208acc8f100d963b82c7674 Reviewed-on: https://chromium-review.googlesource.com/183250 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b155bbcb 2014-01-13T09:51:03 Properly clamp stencil mask query values to max int. We could overflow when casting from max unsigned int to integer, and return a negative mask. See dEQP functional.state_query.stencil_value_mask_getfloat Change-Id: I59189a40b662ad9d8ded79cdfeded923b98f0b85 Reviewed-on: https://chromium-review.googlesource.com/181780 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 28576da5 2014-01-13T14:20:10 Don't include windows.h on non-windows systems. Change-Id: I8cf650073ead5b52bac44e31c8c3c894bc31e01c Reviewed-on: https://chromium-review.googlesource.com/182320 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 3929c1c4 2013-12-05T11:48:38 Store the commit date in version.h, and in the DLL properties. This will allow Chrome, or other apps who reference ANGLE internally, to pull chronological version information about ANGLE. Change-Id: I7dbd5b60b533f176b34f7248d70a1d9757ae99d6 Reviewed-on: https://chromium-review.googlesource.com/179100 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Reviewed-by: Nicolas Capens <nicolascapens@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@chromium.org> Tested-by: Nicolas Capens <nicolascapens@chromium.org>
Jamie Madill 049108df 2013-11-19T10:41:49 Include the current commit as part of the build process. BUG=angle:529 Change-Id: I6d1d227b495e9bae6e017c88642679210c6d2355 Reviewed-on: https://chromium-review.googlesource.com/177233 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Commit-Queue: Shannon Woods <shannonwoods@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Jamie Madill f4b79ba8 2013-11-26T10:38:18 Fix issues with the conditional discard workarounds to do with assignments. The old modifiesState method really checked if an operator was an assignment, so restored that behaviour and use the new side effects detection only for the new code. ANGLEBUG=486 BUG= R=nicolascapens@chromium.org, zmo@chromium.org Review URL: https://codereview.appspot.com/22130043 Change-Id: I84d4e95a0457e63f237a814d80e4f72dd861496b
Jamie Madill 3c9eeb97 2013-11-04T11:09:26 Disable optimizations for shaders with conditional discard in D3D9, and only use expanded short-circuiting conditionals for expressions with potential side-effects. Conservatively assume aggreate and selection operators have side effects for now. BUG= ANGLEBUG=486 R=geofflang@chromium.org, kbr@chromium.org, nicolas@transgaming.com, shannonwoods@chromium.org Review URL: https://codereview.appspot.com/14441075 Conflicts: src/common/version.h src/compiler/translator.vcxproj src/compiler/translator.vcxproj.filters src/compiler/translator/OutputHLSL.cpp src/libGLESv2/ProgramBinary.cpp src/libGLESv2/Shader.cpp src/libGLESv2/Shader.h Change-Id: Iaf9f10b5de7b33c927ef032f3c4fe9d5095f64dd
Shannon Woods bf551589 2013-11-22T14:12:05 Bump version.h Change-Id: Iaefd68999cf7e378561d2136b6aed28058a767c4
Geoff Lang dd7234c5 2013-10-16T15:07:55 Remove un-referenced functions. TRAC #23785 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
Geoff Lang 8690da8b 2013-10-08T10:57:09 Merge 49cbc5768c15d930d5d8751f5263e9546a07d037 from master. Fix a typo introduced in "GCC Compiler Fixes". ANGLEBUG=478 BUG= R=shannonwoods@chromium.org Review URL: https://codereview.appspot.com/14155043
Geoff Lang 6850947e 2013-10-07T17:06:30 Added a define that removes d3d includes from the common directory so that d3d9 headers are not included in the translator project.
Geoff Lang 17732823 2013-08-29T13:46:49 Moved the compiler source files into directories based on their project and added a compiler.gypi to generate the compiler projects.
Geoff Lang d0f8e82b 2013-09-30T15:21:53 Implement META_ASSERT with static_assert if the compiler supports it. TRAC #23948 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
Jamie Madill 4f1a8639 2013-09-24T10:13:04 Add helper functions to determien if addition and mulutiplication of unsigned values will cause an overflow. TRAC #23842 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
Zhenyao Mo cc4ec64c 2013-09-23T14:57:10 Use the same mechanism to process int/float literals This also fixes the float overflow errno leaking bug. BUG= R=alokp@chromium.org Review URL: https://codereview.appspot.com/13368050
Zhenyao Mo ac44cd2b 2013-09-23T14:57:09 Add an option in ANGLE shader translator to initialize gl_Position to vec4(0.0, 0.0, 0.0, 1.0). This is to work around driver bugs where shader compile or program link would fail incorrectly if gl_Position is not set in vertex shader. At the moment at least Linux NVIDIA driver has this bug. ANGLEBUG=472 R=alokp@chromium.org, kbr@chromium.org Review URL: https://codereview.appspot.com/13509043
Zhenyao Mo a15f3e84 2013-09-23T14:57:08 Expose the packing function so we can check varyings packing per program ANGLEBUG=471 R=kbr@chromium.org Review URL: https://codereview.appspot.com/13322043
Zhenyao Mo f1d723c6 2013-09-23T14:57:07 Clamp numeric overflow rather than failing with an error BUG=249086 ANGLEBUG=468 TEST= R=alokp@chromium.org, kbr@chromium.org Review URL: https://codereview.appspot.com/13195043
Zhenyao Mo d2d340b0 2013-09-23T14:57:05 Add static_use to shader variable info query. BUG=249018 ANGLEBUG=465 R=kbr@chromium.org Review URL: https://codereview.appspot.com/13158043
Zhenyao Mo fa3c346f 2013-09-23T14:57:04 Build fix: not all types support precisions. Currently Angle translator made the wrong assumption that all variables have a precision, and ASSERT that. BUG=276031 TBR=alokp@chromium.org Review URL: https://codereview.appspot.com/13113044
Zhenyao Mo 74da9f2f 2013-09-23T14:57:01 Expose varying variables and also precision for all variables. ANGLEBUG=457 R=alokp@chromium.org, kbr@chromium.org Review URL: https://codereview.appspot.com/12487043
Al Patrick 3c6344e7 2013-09-23T14:57:00 add TRACE_EVENT to ANGLE (reland) Tracing code the same as previous CL: https://codereview.appspot.com/12699047/ Setup code simplified, and follows the GetProcAddress model of other gl functions. R=shannonwoods@google.com
Jamie Madill d3f0f1ec 2013-09-20T13:31:08 Expose and generalize Clear11's CompareStates function, and add methods for equality test and initialization. TRAC #23841 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
Jamie Madill 66192b3e 2013-09-09T15:41:37 Add GL_STRUCT_ANGLEX case handling to the variable row and column count methods. TRAC #23749 Signed-off-by: Nicolas Capens
Jamie Madill 28167c62 2013-08-30T13:21:10 Add support for struct varyings, and more robust varying link validation. TRAC #23749 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens
Geoff Lang 0bbd11c1 2013-08-21T14:42:01 Fix Texture2DArray calling Texture::set/subImage with invalid pointers when the pixels pointer is NULL. TRAC #23767 Author: Geoff Lang Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods
Shannon Woods 5fe0caa1 2013-08-19T14:28:47 Adds size and offset queries to BindingOffsetPointer TRAC #23468 Author: Shannon Woods Signed-off-by: Jamie Madill Signed-off-by: Nicolas Capens