src/common/angleutils.cpp


Log

Author Commit Date CI Message
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>
Jamie Madill 42975644 2017-10-12T12:31:51 Move incomplete texture logic to shared helper. The incomplete texture handling is similar between the D3D and Vulkan back-ends. We create 1x1 textures, initialize them to black, and bind them when we detect incomplete textures. We would also bind incomplete textures when we detect feedback loops. In the GL back-end, we wouldn't detect feedback loops, and would allow the driver to handle incompleteness. Instead implement this in a shared helper class, and do the feedback loop detection in the front-end for every back-end. This makes our behaviour more consistent between back-ends, and prevents undefined behaviour. Because initializing multisample textures is tricky (they can't be updated with TexImage calls) we do a bit of a workaround so the back-end can clear the incomplete multisample texture initially. This progresses the initial Vulkan textures implementation. BUG=angleproject:2167 Change-Id: I79ddcc0711fcc986f2578a52ac6f701231d241ac Reviewed-on: https://chromium-review.googlesource.com/700993 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho c853804c 2017-09-27T11:20:15 Add support for arrays of arrays to VariableLocation Array indices are sorted so that the outermost index is in the back. This is because we want to be consistent with future arrays of arrays parsing code. In parsing we'll have a utility function to make a TType object into an array, and there it's most natural to push the new outermost sizes to the back of the vector. Further patches will still be needed to parse arrays of arrays and add support to arrays of arrays into the API. BUG=angleproject:2125 TEST=angle_unittests, angle_end2end_tests Change-Id: I6c88edabf68ae9dbd803ec6d20543016c408b702 Reviewed-on: https://chromium-review.googlesource.com/686414 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Yuly Novikov b9c53d8d 2017-07-19T18:55:16 Remove FormatString And the global static it uses. BUG=angleproject:1644 Change-Id: I6c8b186ef0dce83fe64620729af4d87ea81c77f5 Reviewed-on: https://chromium-review.googlesource.com/577922 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez a8ccb95b 2016-12-16T15:12:57 FormatString: avoid an UB when we need to grow the buffer A va_list is undefined after it has been used by vsnprtinf. This was causing crashes in the GL backend when the driver was returning big info logs. BUG=chromium:668223 Change-Id: I444194ecce2846960c8a27f20f322f7099c651e5 Reviewed-on: https://chromium-review.googlesource.com/421271 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill c9bdeff4 2016-02-08T12:36:55 D3D11: Refactor RenderTarget apply into StateManager11. This is a refactoring patch only, and doesn't change the behaviour. The intent is to make it easy to turn on the Framebuffer dirty bits in a subsequent patch, once we can cleanly handle textures and renderbuffers getting recreated. BUG=angleproject:1260 Change-Id: Iaa5cfe222b020724e088eee5f1ae909b6f981a08 Reviewed-on: https://chromium-review.googlesource.com/325423 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e4ea202a 2015-03-26T20:35:05 Revert "Compile the D3D11 VS and PS on separate threads at GL link time" Causing a high-volume crashe in Chrome. This reverts commit 434953e20002666f66d721aaacbcb8410f7dbd56. BUG=470695 Change-Id: I2062c706ab6ca6b4c3117685df67c33572518da5 Reviewed-on: https://chromium-review.googlesource.com/262704 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 434953e2 2015-02-20T10:49:51 Compile the D3D11 VS and PS on separate threads at GL link time Change-Id: Ib534483f2ec3922cfeaf71cf1d9e9c433fe04b08 Reviewed-on: https://chromium-review.googlesource.com/251612 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6df9b37d 2015-02-18T21:28:19 Revert "Re-resubmit "Compile the D3D11 VS and PS on separate threads at GL link time"" Fails clang-win again. Apparently Clang mimics MSVS. This reverts commit af1bdff62ec4cc80b47fbac7e5d973f6f7225036. Change-Id: I48a503889a9e905fcdc9f101dbf98f7cb7912279 Reviewed-on: https://chromium-review.googlesource.com/250882 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross af1bdff6 2015-02-17T11:07:46 Re-resubmit "Compile the D3D11 VS and PS on separate threads at GL link time" The latest version of this change disables multithreaded D3D shader compilation with any C++ compiler other than VC (e.g. Clang). Change-Id: If3ef5fd650055ae66397ea2c9121bfcf1792892a Reviewed-on: https://chromium-review.googlesource.com/250328 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill d2d21dca 2015-02-17T18:07:01 Revert "Resubmit "Compile the D3D11 VS and PS on separate threads at GL link time"" Causes errors in Clang-Win. We can fix the error and then resubmit, but need to do a roll now. This reverts commit 310184861bab5e95139e0f34b1f8e88fe8c677b8. Change-Id: I1c91b0a97031df33c2261089f6b54ccd3270306b Reviewed-on: https://chromium-review.googlesource.com/250430 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 31018486 2015-01-30T13:06:52 Resubmit "Compile the D3D11 VS and PS on separate threads at GL link time" The original change caused a Chromium build break due to "__uncaught_exception" not being defined in concrt.h. This is because Chromium defines "_HAS_EXCEPTIONS=0" in its GYP, but ANGLE doesn't do this. This change defines "_HAS_EXCEPTIONS=0" in ANGLE's GYP to match Chromium, and refines it in ProgramD3D.cpp before including <future>. Change-Id: Ic324702569bac8f4ae1381f308c4f3f11f190f9e Reviewed-on: https://chromium-review.googlesource.com/244860 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9d294c33 2015-01-30T19:58:39 Revert "Compile the D3D11 VS and PS on separate threads at GL link time" Failing compile on Chromium bots: FAILED: ninja -t msvc -e environment.x86 -- C:\b\build\goma/gomacc "C:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\third_party\angle\src\libANGLE\renderer\d3d\libANGLE.ProgramD3D.obj.rsp /c ..\..\third_party\angle\src\libANGLE\renderer\d3d\ProgramD3D.cpp /Foobj\third_party\angle\src\libANGLE\renderer\d3d\libANGLE.ProgramD3D.obj /Fdobj\third_party\angle\src\libANGLE.cc.pdb c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\concrt.h(4774) : error C3861: '__uncaught_exception': identifier not found ninja: build stopped: subcommand failed. This reverts commit 6d51f2629a8118f7afd450ea832c93143a84c330. Change-Id: Iebb2843dfbc3795290fbb33e1a111ddad59c3126 Reviewed-on: https://chromium-review.googlesource.com/244792 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross 6d51f262 2015-01-26T16:34:48 Compile the D3D11 VS and PS on separate threads at GL link time BUG=angle:900 Change-Id: Iad5dbbcc676e2a2b6dfc3d7bc6ab5957154de33e Reviewed-on: https://chromium-review.googlesource.com/240490 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Geoff Lang 2207213b 2014-11-20T15:15:01 Move as many files as possible from common to libANGLE. BUG=angle:733 Change-Id: If01c91cd52ac5c2102276a9fdc4b68ebc13e47f9 Reviewed-on: https://chromium-review.googlesource.com/231850 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 4349ab85 2014-11-25T15:53:34 Revert "Move as many files as possible from common to libANGLE." Chromium directly includes our common/version.h and couldn't build after this change. This reverts commit f0a2c7727f9863c38a435a16a69d513c481fbbdd. Change-Id: Iafc41b1a3973f609518fe3588fdb64cecc285332 Reviewed-on: https://chromium-review.googlesource.com/231840 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang f0a2c772 2014-11-20T15:15:01 Move as many files as possible from common to libANGLE. BUG=angle:733 Change-Id: I40cee6e2e305ac493acbc8649f858785c0569aed Reviewed-on: https://chromium-review.googlesource.com/231051 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross 922a9fb3 2014-10-21T14:26:33 Use D3D11 Debug Annotations when D3D9 is unavailable Change-Id: I37ac5fe7f0b2fe5e71bd7f0afca55e9894f3463c Reviewed-on: https://chromium-review.googlesource.com/224512 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 86ffde57 2014-10-03T14:51:54 Fix building angleutils.cpp on Linux vsnprintf is defined in stdio.h according to the standard. It was not in the include chain of angleutils.cpp, which broke the build on Linux on some configurations. Seems like other toolchains include the function in some non-standard way. BUG=angle:761 Change-Id: Idcd75776e8a9b83dad182d1b4bac0beac006c6ac Reviewed-on: https://chromium-review.googlesource.com/221053 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@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>
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>
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>