src/common/mathutil.h


Log

Author Commit Date CI Message
Lubosz Sarnecki 1cc5d096 2021-10-21T19:58:58 mathutil: Add roundDownPow2. Bug: angleproject:5857 Change-Id: I6c7ae92a41957e9e6b40b6449f763a49493488d1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3236996 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mark Lobodzinski fde87f5d 2021-10-06T15:10:09 Fix negative fixed-point->float conversions The fixed-to-float conversion routine in mathutils only operated correctly on positive numbers. This caused failures in some GLES1 apps when negative fixed-point values were converted, as for glTranslatex(). Bug: b/199919700 Test: Manual -- Zillow app should show data on map Change-Id: I2ac4794478d3ad4c50057527134c9c17c8680338 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3209826 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mark Lobodzinski <mark@lunarg.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Shahbaz Youssefi d920e4d1 2021-10-05T22:36:06 Assert that float32->float10/11 doesn't shift by more than 32 some_uint32_value >> 32 has undefined behavior. The code that converts float32 to float10 and float11 should not be shifting by values larger than 32, and this change asserts that. Bug: angleproject:4962 Change-Id: I9f2a914bad7084157cc35a8fb7f0be6f448a854b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3207528 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Alexis Hétu <sugoi@chromium.org>
Jamie Madill e0e5eb84 2021-04-21T20:58:12 Fix ScanReverse on posix/32-bit. The use of the __builtin_clz intrinsic and the associated math were incorrect. Bug: angleproject:5736 Change-Id: I9627c7fc179c0e1bffeecaee39f7a88d9c62d079 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2845232 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill cfc21345 2021-04-21T09:42:51 Add first() and last() to BitSetArray. These helper functions return the bounds of the 1 bits in the array. Also required implementing ScanReverse the same way we implemented ScanForward. Bug: angleproject:5736 Change-Id: Ied945c57cd85ca7bc91dcc7a1168a74b3a59fce4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2842347 Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Alexis Hetu 36b884e6 2020-09-02T19:21:21 Fix undefined behavior in minifloat conversion This cl applies the same fix already applied in SwiftShader here: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48069 Original description: Shifting a 32-bit value by 32 or more is undefined behavior in C++. This previously happened in this code when converting a 32-bit float value to an 11- or 10-bit minifloat which is too small to be represented as a denormal, and should produce 0 instead. Instead of going through this arithmetic for denormals, just test whether the input value is too small to produce a valid denormal, and return 0 instead. Bug: chromium:1117433 Change-Id: I227c0e4c53000df6d9260fee364351a300b113a2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2391764 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Anders Leino 6820f77a 2020-05-22T17:50:03 Fix issue where last 8 bits of D24X8 influence depth calculation. Bug: angleproject:4573 Change-Id: If33737cf6ae660b8df58c06a08df32dade472540 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2211768 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 31e36a63 2020-03-14T21:40:58 Reland "Refactor BitCount" This is a reland of baecb7d55c692a93a29a46939029b8262174ca62 Directly use NEON instructions on ARM/ARM64 on MSVC. Original change's description: > Refactor BitCount > > POPCNT intrinsics cannot be used without hardware support, so a CPUID > check and polyfills are required for some CPUs when using MSVC to > avoid runtime failure. > > Other changes include: > - Clang: use builtins on all platforms to provide exact intent to the > compiler; > - MSVC on ARM: use dedicated intrinsics; > - x86/x64 fallback is now branchless and works in constant time. > > Bug: angleproject:4462 > Change-Id: I00fcabda1c842677d8cb4bfd280d932d0d10c0a5 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2102811 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: angleproject:4462 Change-Id: Ia58ae00fa4230f77d981d4ba393fa3481806c5b0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2113570 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 26f8f1a9 2020-03-20T14:54:11 Revert "Refactor BitCount" This reverts commit baecb7d55c692a93a29a46939029b8262174ca62. Reason for revert: Broke Skia Win/ARM builder. See issue for details. Original change's description: > Refactor BitCount > > POPCNT intrinsics cannot be used without hardware support, so a CPUID > check and polyfills are required for some CPUs when using MSVC to > avoid runtime failure. > > Other changes include: > - Clang: use builtins on all platforms to provide exact intent to the > compiler; > - MSVC on ARM: use dedicated intrinsics; > - x86/x64 fallback is now branchless and works in constant time. > > Bug: angleproject:4462 > Change-Id: I00fcabda1c842677d8cb4bfd280d932d0d10c0a5 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2102811 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,lexa.knyazev@gmail.com Change-Id: Ia1756abdf7da2aa9574149eb388915f97758bba0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:4462 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2112276 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Alexey Knyazev baecb7d5 2020-03-14T21:40:58 Refactor BitCount POPCNT intrinsics cannot be used without hardware support, so a CPUID check and polyfills are required for some CPUs when using MSVC to avoid runtime failure. Other changes include: - Clang: use builtins on all platforms to provide exact intent to the compiler; - MSVC on ARM: use dedicated intrinsics; - x86/x64 fallback is now branchless and works in constant time. Bug: angleproject:4462 Change-Id: I00fcabda1c842677d8cb4bfd280d932d0d10c0a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2102811 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev e6519445 2020-03-12T19:02:03 Implement ScanForward64 on 32-bit platforms This unlocks opt-in usage of BitSet64 on 32-bit platforms. It is slightly faster than IterableBitSet when the amount of bits is greater than 32. Bug: angleproject:4473 Change-Id: I230784acc871e13b1f94c87503f6bb869dcd3a68 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2100969 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 01c0d6bd 2020-01-12T13:41:31 Vulkan: Use dynamic buffers for staged updates Dynamic buffers are used to perform staged updates to BufferVk objects instead of recreating staging buffers for each update. Bug: angleproject:4292 Change-Id: I0f64c821c97e0e6014e9df1d4f99e2f495838025 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2001461 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Le Quyen d200a77a 2019-10-10T00:44:01 Metal backend skeleton implementation. Bug: angleproject:2634 Change-Id: I34be82f4a80a6851fecb53a51e069b134d82613a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1849079 Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
James Darpinian 153f3c22 2019-08-16T15:24:30 Miscellaneous build fixes for WebKit Add a USE_SYSTEM_EGL define to allow compilation on Unix systems without X11. Feature detect __popcnt using Microsoft-specific _MSC_VER rather than _M_X64/_M_IX86, which can be set by the Dinkumware stdlib on non-Microsoft systems. Apple's clang is too old to have -Wextra-semi-stmt Ran generate_parser.sh using Cygwin64 bison 3.0.4, flex 2.6.4 Bug: 3439 Change-Id: Ie0d01a112a17f70ef60c120063a958b8f1a094f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1759135 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiacheng Lu 3e493c48 2019-07-29T16:27:01 Vulkan: Optimize memory allocation offset rounding Use bit operation to compute memory alignment round up. Tested with T-Rex, hotspot in roundUp resolved. Bug: angleproject:3744 Change-Id: I55db941f588401a1d2d3d93f4d6b810e6b1aa95f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1725118 Commit-Queue: Jiacheng Lu <lujc@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Tim Van Patten cbabea73 2019-07-11T17:24:17 Vulkan: Desktop ETC/EAC formats support Initial attempt to give desktop ETC/EAC formats support. Bug: angleproject:3676 Change-Id: Id147b0c1808e30df77097d0c7ff6a06534554b93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1699307 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jose Dapena Paz dd3de6f0 2019-07-22T21:17:52 Do not assume __has_builtin is available Compilation with GCC breaks as there is a build check using it. To avoid the problem, we declare the macro HAS_BUILTIN that maps to __has_builtin if it is defined, or 0 otherwise. Bug: chromium:819294 Change-Id: I105d566f08baa495fccd553d7b06eb8ce36621ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713604 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi e9111885 2019-07-12T16:15:31 Vulkan: Optimize texture upload barriers When flushing staged uploads to an image, a 64-wide bitfield is used to track subresources that are uploaded since the last barrier. If a collision is detected, a barrier is inserted and the bitfield is reset. If the image has more than 64 subresources, some subresources would map to the same bit and cause a few unnecessary barriers. Texture upload benchmarks show 5% to 10% improvement both in CPU and GPU time. Bug: angleproject:3347 Change-Id: I21dd23c78879bb01d58bc869ffc8bee06c79e6c1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1700147 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Tim Van Patten db990834 2019-06-26T16:05:02 Support NaN conversion in Float32ToFloat16 Add NaN support to Float32ToFloat16. This follows Dawn's implementation: https://dawn-review.googlesource.com/c/dawn/+/8361 Bug: 3612 Test: angle_unittests Change-Id: I624bee2fc48c46b8a69cd38654679ac3cbd7c09f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1678407 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5993d899 2019-06-03T13:05:38 Vulkan: Use storage buffers for index conversion shader. This allows us to use the shader regardless of driver support for texel buffer views. It also allows us to convert indices on the GPU unconditionally. We add a new internal compute shader that converts pairs of indices into a packed single uint value that stores two 16-bit values. In the future we could add support for converting primitive restart indices. Should speed up benchmarks on systems which didn't have R8_UINT support for compute shader buffers. Bug: angleproject:3490 Change-Id: I56ca0cabb094e97f36ab4edc779e6c8ad2d2601e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1639058 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 3f0c4a56 2019-01-10T10:20:35 Vulkan: Faster state transitions. Implements a transition table from Pipeline Cache entry to state change neighbouring Pipeline Cache entries. We use a 64-bit mask to do a quick scan over the pipeline desc. This ends up being a lot faster than doing a full hash and memcmp over the pipeline description. Note that there could be future optimizations to this design. We might keep a hash map of the pipeline transitions instead of a list. Or use a sorted list. This could speed up the search when there are many transitions for cache entries. Also we could skip the transition table and opt to do a full hash when there are more than a configurable number of dirty states. This might be a bit faster in some cases. Likely this will be something we can add performance tests for in the future. Documentation is also added in a README file for the Vulkan back end. This will be extended over time. Improves performance about 30-35% on the VBO state change test. Bug: angleproject:3013 Change-Id: I793f9e3efd8887acf00ad60e4ac2502a54c95dee Reviewed-on: https://chromium-review.googlesource.com/c/1369287 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Markus Tavenrath cc37cbf2 2018-12-30T23:35:25 Apply several small micro-optimizations to ValidateDrawElementsCommon * Remove indirection when getting CotextState from Context * Reduce number of branches from 2 to 1 when checking for an InvalidEnum in FromGLEnum<DrawElementsType> * Provide IndexRange constructor which doesn't initialize the member variables * Reduce number of branches to 1 when checking for BasicDrawStateErrors for the fast path * Remove a few branches and reduce math cost during the buffer range check in ValidateDrawElementsCommon Bug: angleproject:2966 Change-Id: Ibdbed8a59ad9d7abce76622e9f507498e67ab997 Reviewed-on: https://chromium-review.googlesource.com/c/1392805 Commit-Queue: Markus Tavenrath <matavenrath@nvidia.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>
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>
Jeff Gilbert c0b82333 2018-09-26T18:04:05 Polyfill BitCount for ARM/ARM64 on MSVC. Also _WIN64 implies _WIN32. Bug: angleproject:2858 Change-Id: I63e2ffd2e9e304171ea6adb99836733981cc1813 Reviewed-on: https://chromium-review.googlesource.com/1248441 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Thomas Miller cb4ae446 2018-08-02T08:19:09 Make Angle compile for Arm64 Windows Change-Id: Iee947a5abf4a833f155f7cb100577c92323a34e5 Reviewed-on: https://chromium-review.googlesource.com/1160863 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Lingfeng Yang 0df813c3 2018-07-12T12:52:06 GLES1: GL_OES_draw_texture BUG=angleproject:2306 This implements GL_OES_draw_texture using a few bits of new state in the renderer and adding a code path for it in the shader, using gl_VertexID to draw the quad backing the texture draw. This allows us to avoid allocating a separate vertex array for the texture draw and reuses the current shader as much as possible, plugging in to the existing multitexturing pipeline. - Add unit test and sample - No new test expectations, but advertising GL_OES_draw_texture makes the DrawTex GLES1 conformance test non-trivial and actually test glDrawTex*. Change-Id: I1485098249fe44d46a01cab4bb7b2c39d0492923 Reviewed-on: https://chromium-review.googlesource.com/1135930 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Jamie Madill 7ce4a151 2018-06-12T10:19:49 Add support for uint8_t and uint16_t bitsets. These pack very well in some structs. Support is required so the templates work as expected. Also packs the Shader map into 8 bits. This includes a workaround for an unusual warning generated by MSVC. Bug: angleproject:2462 Change-Id: I804d1b9370b3951343718385210dec7d37700d73 Reviewed-on: https://chromium-review.googlesource.com/1091135 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Lingfeng Yang 13b708f2 2018-03-21T12:14:10 GLES1: glAlphaFunc BUG=angleproject:2306 Change-Id: I0bf229d3ab8a4a1217c12b434dcd8fa67d7cbadc Reviewed-on: https://chromium-review.googlesource.com/973897 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8c3988c5 2017-12-21T14:44:56 Vulkan: Use one pipeline layout for all Programs. This simplifies the pipeline state object caching. We will not need to use any extra bits to cache based on program properties - instead all programs will be compatible. The pipeline layout strucutre is described in the design docs. It currently only has two bind groups: the first for default uniforms, and the second for Textures. In the future we might re-organize this to handle driver uniforms, dynamic push constants, and/or program uniform buffers with ES 3.0. Instead of storing only the Textures that are required by a Program, we reserve space for the maximum possible Texture units. We might have to revisit this very simple design in the future to support texture arrays, which are handled specially in Vulkan. Bug: angleproject:2163 Change-Id: I3e1656c2c73045aed56838a5f1267b246a623362 Reviewed-on: https://chromium-review.googlesource.com/837943 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov c4f1dd83 2017-10-25T17:02:29 Use angle::BitSetIterator optimizations on arm64 as well Previously were enabled only on x86_64. Also change from using target_cpu to current_cpu, as the doc recommends. BUG=angleproject:1814 Change-Id: Ia7e8e930c76aab5cfb47b75e0ec78902ab313237 Reviewed-on: https://chromium-review.googlesource.com/737438 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Olli Etuaho a87121f9 2017-10-06T14:07:27 Fix build warning by specializing clampCast Casting integers to booleans generates a performance warning in at least MSVS 2015 x64 Debug build. Specialize the clampCast template for bool->int conversion to avoid this warning, which is treated as an error. BUG=angleproject:2165 TEST=MSVS 2015 x64 Debug build Change-Id: Iaa9591c102cdd73fe9ff8a8739d356cc13cec248 Reviewed-on: https://chromium-review.googlesource.com/704820 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 a99ed554 2017-09-22T08:10:32 Refactor data conversions for state commands This mainly enforces the rules as descripted in ES 3.10, section 2.2.1 and 2.2.2, by enhancing the "queryconversions" to support more rules, removing the scattered type convertors in "utilities" , "mathutil" and "queryutils", and forcing to only use the convertors in "queryconversions". BUG=angleproject:2165 Change-Id: I73c1dc850e2b3b8a479ece1d9c5eb7ae4ce851fe Reviewed-on: https://chromium-review.googlesource.com/680094 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 982f6e01 2017-06-07T14:33:04 Improvements to the gl::Range class. Make this a proper class, fix the extends method (previously did not work as expected), add a contains method, and add tests. Also add an iterator helper class so we can iterate over the range with range-for loops. This also fixes the shader resource unsetting code, which was not actually unsetting all the possible applied textures. BUG=angleproject:2052 Change-Id: I2a6fa97f96ccb612ad01a5e3f24dc869c54c967b Reviewed-on: https://chromium-review.googlesource.com/527318 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5ea762a6 2017-06-07T14:59:51 Consolidate base:: imports. This merges the mrucache and numerics into one folder, to prevent having to make two identical versions of logging. BUG=angleproject:2044 Change-Id: Iba6dab05b21eb9ba0de44f27a90579c590a9a7fd Reviewed-on: https://chromium-review.googlesource.com/522870 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 451b2b7f 2017-05-15T15:32:02 Correctly generate mipmaps for sRGB textures. sRGB textures need to linearize their data before averaging, this worked correctly on the GPU mipmap generation functions but not the CPU ones. BUG=angleproject:2019 TEST=conformance/extensions/ext-sRGB Change-Id: I554dac89b12acf5ebf5b7cab6f6faf0bce5168a6 Reviewed-on: https://chromium-review.googlesource.com/506241 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6de51858 2017-04-12T09:53:01 Optimize angle::BitSetIterator. Adds a new custom bitset template to handle packing as many bits as possible into a single variable. Intelligently select the right class depending on platform features and bit sizes. For now, always use a packed 64-bit set on 64-bit, instead of using a 32-bit set for smaller bitsets. BUG=angleproject:1814 Change-Id: I3ffef815c15515555833f6fc9302d8a4eee5423b Reviewed-on: https://chromium-review.googlesource.com/471827 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
shinchiro f8de6667 2017-01-29T18:41:29 Fix compilation on mingw BUG=angleproject:1795 Change-Id: Ic25805f99154395c9af28197ceb1218f9c5c3138 Reviewed-on: https://chromium-review.googlesource.com/434457 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 74da73fe 2017-02-01T15:37:48 Add ESSL 3.10 ldexp/frexp builtins This adds new built-ins found in ESSL 3.10 section 8.3 Common Functions. This includes constant folding support for ldexp and support for both GLSL and HLSL output. In HLSL these functions need to be emulated. BUG=angleproject:1730 TEST=angle_unittests Change-Id: I1330e69978b0cf53efbc3416150194764414e96c Reviewed-on: https://chromium-review.googlesource.com/435342 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 25aef453 2017-01-29T16:15:44 Add new ESSL 3.10 pack/unpack builtins This adds new built-ins found in ESSL 3.10 section 8.4 Floating-Point Pack and Unpack Functions. This includes constant folding support and support for both GLSL and HLSL output. In HLSL all of these functions need to be emulated. BUG=angleproject:1730 TEST=angle_unittests TEST=dEQP-GLES31.functional.shaders.*pack*norm4x8* Change-Id: Ibed60286a366cd35c4faafd405e79af562a02a06 Reviewed-on: https://chromium-review.googlesource.com/434170 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 9250cb24 2017-01-21T10:51:27 Add ESSL 3.10 integer math built-ins This adds built-ins found in ESSL 3.10 section 8.8 Integer functions. This includes constant folding support for functions that may be constant folded, and support for both GLSL and HLSL output. In HLSL several of the functions need to be emulated. The precision qualification for the return value of some of these functions is determined by special rules, that are now part of type promotion for TIntermUnary nodes and determining the type of TIntermAggregate nodes. BUG=angleproject:1730 TEST=angle_unittests TEST=dEQP-GLES31.functional.shaders.builtin_functions.integer.* Change-Id: Ib0056c17671c42b6496c2f0ef059b99f8f25c122 Reviewed-on: https://chromium-review.googlesource.com/431310 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 0c7baf1b 2016-12-19T15:43:10 Implement the WebGL VertexAttribPointer restrictions BUG=angleproject:1523 BUG=chromium:668223 Change-Id: Ic89c476a6c95824069772e22ede596ba85ac8859 Reviewed-on: https://chromium-review.googlesource.com/422347 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 922cbfcb 2016-11-25T16:23:18 common: Add a vector arithmetic helper classes Change-Id: I2f96baedf10d346eaa150bab04f8f6ca3ba573b9 Reviewed-on: https://chromium-review.googlesource.com/414272 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 26a717b0 2016-09-27T08:45:42 GL: Emulate SRGB blits where needed. Desktop OpenGL before 4.4 doesn't handle SRGB blits the same way OpenGL ES does. Emulate them by drawing a quad. BUG=angleproject:1492 BUG=chromium:634525 Change-Id: I9f2992d9b373941b10f19f8a51564f0f756cc4df Reviewed-on: https://chromium-review.googlesource.com/389853 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 7f9a55f7 2016-10-03T14:32:08 Fix integer math overflows in the preprocessor Evaluating integer expressions in the ESSL preprocessor may result in overflowing the signed integer range. Implement wrapping overflow for preprocessor expressions in a way that doesn't hit any undefined behavior. In the ESSL spec, preprocessor expressions are defined to have mostly the same semantics as in C++. Since C++ doesn't define what happens on signed integer overflow, we choose to make most of the operators wrap on overflow for backward compatibility and consistency with the rest of the ESSL spec. We reuse the existing wrapping overflow helpers that are used for constant folding. To be able to do this, the type used in the preprocessor expression parser is changed from 64-bit to 32-bit. Shifting negative numbers is implemented as a logical shift. This cannot be disallowed since dEQP requires shaders shifting negative numbers to pass compilation. Undefined bitwise shifts where the offset is greater than 31 will now result in a compile-time error. A couple of test cases are now covered by the preprocessor tests rather than full compilation tests. This isolates the tests better and they run faster. BUG=chromium:652223 TEST=angle_unittests Change-Id: I84be40d404c10ecd0846c5d477e626a94a2a8587 Reviewed-on: https://chromium-review.googlesource.com/392146 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 5695fc99 2016-07-05T14:47:30 Clean up the SSE detection logic. * Include the correct header right in the SSE check in platform.h. * Don't use separate SSE versions of the load functions, have them use SSE automatically. BUG=612205 Change-Id: I70f9a5513e144db4d16c1f3ad922debeb6c50268 Reviewed-on: https://chromium-review.googlesource.com/358108 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 6e4cfceb 2016-06-13T15:06:31 Refactor ANGLE's image manipulation code into a static library. Allows for chromium to make use of some of the functionality. BUG=612205 Change-Id: Ib4435ca44775a3a554b0fb3bd384bd4d31d7952d Reviewed-on: https://chromium-review.googlesource.com/351753 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Sami Väisänen e45e53bd 2016-05-25T10:36:04 Support CHROMIUM_path_rendering This is partial support for CHROMIUM_path_rendering and implements basic path management and non-instanced rendering. BUG=angleproject:1382 Change-Id: I9c0e88183e0a915d522889323933439d25b45b5f Reviewed-on: https://chromium-review.googlesource.com/348630 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e2e406c3 2016-06-02T13:04:10 Add base::numerics for safe math and conversions. This replaces are "IsUnsignedXXXSafe" family of methods. Also add overflow checks to unpack block sizes. BUG=angleproject:1397 Change-Id: Ib47be149b0486c70f795b0d0f8899441faac9340 Reviewed-on: https://chromium-review.googlesource.com/348062 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 0f2b1560 2016-05-13T16:15:35 Fix GenerateMipmap when base level or max level are set According to GLES 3.0.4 section 3.8.10, GenerateMipmap should generate levels based on the base level, and generate them at most up to the max level. Levels outside the base/max level range should be unchanged by GenerateMipmap. The Texture class is fixed so that the image descs are set only for the changed mipmap range when GenerateMipmap is called. The D3D backend is fixed so that mipmap generation is correctly started from the base level instead of level 0, and making sure that mipmaps are generated only up to the max level. Generating mipmaps for array textures is also fixed for cases where the base level depth >= max(width, height) * 2. The GL backend is fixed to sync texture state before GenerateMipmap is called, so that base level and max level are set correctly in the driver. The GenerateMipmap entry point is refactored so that it has a separate validation function and a context function which does the work. Validation for out-of-range base levels is added. New tests are added to verify the functionality. One corner case in the tests fails on NVIDIA GL drivers likely due to a driver bug - similar rules for GenerateMipmap are found from newer GLES specs and also OpenGL specs (checked versions 3.3 and 4.4). BUG=angleproject:596 TEST=angle_end2end_tests Change-Id: Ifc7b4126281967fc4f6dc4f9452e5b01e39f83d7 Reviewed-on: https://chromium-review.googlesource.com/344514 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Yuly Novikov 451ed25a 2016-01-21T21:16:45 Fix packSnorm2x16. Casting -32767.0f to uint16_t on Android resulted in 0. According to C99 6.3.1.4 footnote 50 this kind of cast behavior is unspecified BUG=angleproject:913 TEST=build/android/test_runner.py gtest -s angle_unittests --release Change-Id: I136386fe0aa618c17f07f99d8e1ca72fa407d36a Reviewed-on: https://chromium-review.googlesource.com/323230 Tryjob-Request: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Yuly Novikov <ynovikov@chromium.org>
Corentin Wallez ca311ddb 2015-12-07T15:07:48 Enable and fix the -Wshorten-64-to-32 BUG=angleproject:635 Change-Id: If09014508d5f4dfeb17ac946672a76a98b8ad175 Reviewed-on: https://chromium-review.googlesource.com/316580 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 630d85cb 2015-09-30T14:35:48 Fix an undefined behavior in clampCast This undefined behavior appeared in angle_end2end_tests compiled with clang 3.6 on Mac. BUG=angleproject:891 Change-Id: I840b40a7bd54c9cfaeb0fe6784b73f875f9d5502 Reviewed-on: https://chromium-review.googlesource.com/303337 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
hendrikw 75782629 2015-09-25T11:28:50 Fix possible compiler errors on linux Change-Id: Ifc45446c749690eddc406f66f144304262f04664 Reviewed-on: https://chromium-review.googlesource.com/302478 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 3edfe034 2015-09-04T16:38:24 Support primitive restart in RendererGL. Store index ranges in a new struct that tracks how many real indices were seen. Update index caching to key on primitive restart being enabled and update index counting functions to skip primitive restart indicies when needed. Passes dEQP-GLES3.functional.primitive_restart.* Change-Id: Id1e25a5adcdcd4e998836e8ff6679c64be4c3066 Reviewed-on: https://chromium-review.googlesource.com/297770 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 62d31cb6 2015-09-11T13:25:51 Re^6-land "Move Uniform and UBO info to the gl::Program layer." This data was previously stored entirely in the Impl level. Move as much as possible to the GL level, using a read-only view in the Impl level. Some information in D3D-specific, and should be stored separately in the Impl. This patch has a lot of refactoring that splits the D3D and GL info, and moves as much validation as possible to the GL layer, where it is shared between the back-ends. Re-land with fix for dEQP unused uniforms. The fix involves storing a local copy of all uniform data in the GL layer. This will also let us validate sampler indexes during draw calls at the GL layer. Re-re-land with a fix for multiply defined symbols on Clang. Re-re-re-land with a fix for boolean uniforms and Uniform{1234}f. Re^4-land with a fix for boolean uniform arrays and UBO uniforms. Re^5-land with a fix for a test warning on Linux. Re^6-land with a fix for transposed matrix uniform arrays. BUG=angleproject:1123 TEST=end2end_tests, bots, dEQP GLES3.ubo and GLES2.uniform_api Change-Id: Ie6fcde1c16eb05d67191b629338b88302a2563f5 Reviewed-on: https://chromium-review.googlesource.com/298971 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill fb53603c 2015-09-11T13:19:49 Revert "Re^5-land "Move Uniform and UBO info to the gl::Program layer."" Failing dEQP-GLES3.functional.uniform_api.random.22 and 23: There's a bug with arrays of tranpsosed matrix uniforms. BUG=angleproject:1123 This reverts commit 78d356929bd0441d81e2dd8a63130cd6788e2fde. Change-Id: If39b5908af39671dfe98965e6a1ba77fd18ea8fc Reviewed-on: https://chromium-review.googlesource.com/299320 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 78d35692 2015-09-11T08:32:51 Re^5-land "Move Uniform and UBO info to the gl::Program layer." This data was previously stored entirely in the Impl level. Move as much as possible to the GL level, using a read-only view in the Impl level. Some information in D3D-specific, and should be stored separately in the Impl. This patch has a lot of refactoring that splits the D3D and GL info, and moves as much validation as possible to the GL layer, where it is shared between the back-ends. Re-land with fix for dEQP unused uniforms. The fix involves storing a local copy of all uniform data in the GL layer. This will also let us validate sampler indexes during draw calls at the GL layer. Re-re-land with a fix for multiply defined symbols on Clang. Re-re-re-land with a fix for boolean uniforms and Uniform{1234}f. Re^4-land with a fix for boolean uniform arrays and UBO uniforms. Re^5-land with a fix for a test warning on Linux. BUG=angleproject:1123 TEST=end2end_tests, bots, dEQP GLES3.ubo and GLES2.uniform_api Change-Id: I03afcd446d9e74573c4d4c712ed7407b91d8001c Reviewed-on: https://chromium-review.googlesource.com/299180 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a2eb02c9 2015-09-11T12:31:41 Revert "Re^4-land "Move Uniform and UBO info to the gl::Program layer."" Test has a warning on Linux: In file included from ../../third_party/angle/src/tests/test_utils/ANGLETest.h:13: ../../testing/gtest/include/gtest/gtest.h:1392:16: error: comparison of integers of different signs: 'const int' and 'const unsigned int' [-Werror,-Wsign-compare] if (expected == actual) { ~~~~~~~~ ^ ~~~~~~ ../../testing/gtest/include/gtest/gtest.h:1422:12: note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<int, unsigned int>' requested here return CmpHelperEQ(expected_expression, actual_expression, expected, ^ ../../third_party/angle/src/tests/gl_tests/UniformBufferTest.cpp:357:5: note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<int, unsigned int>' requested here EXPECT_EQ(GL_FLOAT, type); ^ BUG=angleproject:1123 This reverts commit 2ae1ee6161c24aab065190b1528f6195e80e34d0. Change-Id: Ic3dabea54068377d1f2c5f722ba52966cf1a0491 Reviewed-on: https://chromium-review.googlesource.com/299170 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2ae1ee61 2015-09-10T10:04:24 Re^4-land "Move Uniform and UBO info to the gl::Program layer." This data was previously stored entirely in the Impl level. Move as much as possible to the GL level, using a read-only view in the Impl level. Some information in D3D-specific, and should be stored separately in the Impl. This patch has a lot of refactoring that splits the D3D and GL info, and moves as much validation as possible to the GL layer, where it is shared between the back-ends. Re-land with fix for dEQP unused uniforms. The fix involves storing a local copy of all uniform data in the GL layer. This will also let us validate sampler indexes during draw calls at the GL layer. Re-re-land with a fix for multiply defined symbols on Clang. Re-re-re-land with a fix for boolean uniforms and Uniform{1234}f. Re^4-land with a fix for boolean uniform arrays and UBO uniforms. BUG=angleproject:1123 TEST=end2end_tests, bots, dEQP GLES3.ubo and GLES2.uniform_api Change-Id: I4c9f5ed31b81380507bef7981f97086d642801ae Reviewed-on: https://chromium-review.googlesource.com/298451 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 61b8dd97 2015-09-09T19:04:04 Revert "Re-re-re-land "Move Uniform and UBO info to the gl::Program layer."" Seems to be failing the dEQP-GLES2.functional.uniform_api tests relating to boolean arrays. BUG=angleproject:1123 This reverts commit 892a6a4b17b35e89898be8b4605c1ee595d3ae13. Change-Id: Ifc4ce3ca806ef88a02ac6f693334ac37ce098a88 Reviewed-on: https://chromium-review.googlesource.com/298520 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 892a6a4b 2015-09-09T10:17:15 Re-re-re-land "Move Uniform and UBO info to the gl::Program layer." This data was previously stored entirely in the Impl level. Move as much as possible to the GL level, using a read-only view in the Impl level. Some information in D3D-specific, and should be stored separately in the Impl. This patch has a lot of refactoring that splits the D3D and GL info, and moves as much validation as possible to the GL layer, where it is shared between the back-ends. Re-land with fix for dEQP unused uniforms. The fix involves storing a local copy of all uniform data in the GL layer. This will also let us validate sampler indexes during draw calls at the GL layer. Re-re-land with a fix for multiply defined symbols on Clang. Re-re-re-land with a fix for boolean uniforms and Uniform{1234}f. BUG=angleproject:1123 TEST=end2end_tests,Canary WebGL (D3D11/GL), dEQP-GLES2+3.functional.uniform_api Change-Id: Ia40820a5ce2f34ec2d27648b1dc940a8955e9999 Reviewed-on: https://chromium-review.googlesource.com/298440 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b654f659 2015-09-08T20:40:00 Revert "Re-re-land "Move Uniform and UBO info to the gl::Program layer."" Failes the gles2_conform_test: GLES2ConformTest.GL2Tests_glGetUniform_input_run Possibly also WebGL failures, will investigate. BUG=angleproject:1123 This reverts commit 10750cb936288d8dd09d49fadd592904c06c56f9. Change-Id: I1ae59325e1831589019bc5a27ffc2091d3994a65 Reviewed-on: https://chromium-review.googlesource.com/298200 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 10750cb9 2015-09-04T14:23:52 Re-re-land "Move Uniform and UBO info to the gl::Program layer." This data was previously stored entirely in the Impl level. Move as much as possible to the GL level, using a read-only view in the Impl level. Some information in D3D-specific, and should be stored separately in the Impl. This patch has a lot of refactoring that splits the D3D and GL info, and moves as much validation as possible to the GL layer, where it is shared between the back-ends. Re-land with fix for dEQP unused uniforms. The fix involves storing a local copy of all uniform data in the GL layer. This will also let us validate sampler indexes during draw calls at the GL layer. Re-re-land with a fix for multiply defined symbols on Clang. BUG=angleproject:1123 TEST=end2end_tests,Canary WebGL (D3D11/GL), dEQP-GLES2+3.functional.uniform_api Change-Id: I7b55e4964fbe64e0106c37928c894146937a2476 Reviewed-on: https://chromium-review.googlesource.com/298110 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2119dd05 2015-09-08T19:30:37 Revert "Re-land "Move Uniform and UBO info to the gl::Program layer."" Problems with multiply defined symbols in the Linux builder. BUG=angleproject:1123 This reverts commit ff1abe63c3d8af28e9755c8d0c95b2aeca27a0d9. Change-Id: Ifcb2ad885d0841c128ffd69afb6594e37eba17fc Reviewed-on: https://chromium-review.googlesource.com/298100 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill ff1abe63 2015-09-04T14:23:52 Re-land "Move Uniform and UBO info to the gl::Program layer." This data was previously stored entirely in the Impl level. Move as much as possible to the GL level, using a read-only view in the Impl level. Some information in D3D-specific, and should be stored separately in the Impl. This patch has a lot of refactoring that splits the D3D and GL info, and moves as much validation as possible to the GL layer, where it is shared between the back-ends. Re-land with fix for dEQP unused uniforms. The fix involves storing a local copy of all uniform data in the GL layer. This will also let us validate sampler indexes during draw calls at the GL layer. BUG=angleproject:1123 TEST=end2end_tests,Canary WebGL (D3D11/GL), dEQP-GLES2+3.functional.uniform_api Change-Id: I9074c057c2c67d4d3221ec11c5556a26e07c7ceb Reviewed-on: https://chromium-review.googlesource.com/297070 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 2c34a4b0 2015-08-25T16:26:02 VertexArrayGL: fix an off by one error for indexRange for drawElements DrawElements' range was of the form [start, end] while DrawArrays' was of the form [start, end), which caused an out of bound array access in the client vertex pointers. This issue was detected while running angle_end2end_tests with AddressSanitizer. BUG=angleproject:1137 Change-Id: Id9abddf29eaf73bacfd08d1616a999be2fe616b8 Reviewed-on: https://chromium-review.googlesource.com/295122 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Arun Patole 551279e5 2015-07-07T18:18:23 Support constant folding of more common built-ins This change adds const folding support for below mentioned common built-ins: - isnan, ininf, floatBitsToInt, floatBitsToUint, intBitsToFloat and uintBitsToFloat BUG=angleproject:913 TEST=angle_unittests(new: MathUtilTest.isNan/inInf), dEQP Tests dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.* (20 more tests started passing with this change) Change-Id: Ifdedb251cd8b183b4999314c0f5de857bc20702f Reviewed-on: https://chromium-review.googlesource.com/283767 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Arun Patole cdfa8f50 2015-06-30T17:48:25 Constant fold float pack/unpack functions This change adds constant folding support for following floating point pack and unpack functions: - packSnorm2x16, unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16, packHalf2x16, and unpackHalf2x16. BUG=angleproject:913 TEST=angle_unittests(new: MathUtilTest.packAndUnpack*), dEQP Tests dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.float_pack_unpack.* (all 10 tests started passing with this change) Change-Id: I2b69faebee4127e5e13900b3a9485b7145950277 Reviewed-on: https://chromium-review.googlesource.com/282683 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Tested-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill aa9e9971 2015-06-22T13:57:16 D3D11: Reduce overhead of clearing unused textures. *re-land with compile fix* We would spend a fair bit of time iterating over the unused textures, setting them to null one-by-one, and updating our cache. We can reduce this time by smarter caching, and skipping unmodified ranges. BUG=angleproject:959 Change-Id: I4de20bc131c4a568108ad670a2ef491cfd4c50ed Reviewed-on: https://chromium-review.googlesource.com/280916 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d4898490 2015-06-22T17:56:18 Revert "D3D11: Reduce overhead of clearing unused textures." Compile error on Windows: error C2561: 'rx::Renderer11::clearTextures' : function must return a value BUG=angleproject:959 This reverts commit 475e5b7f91f8ed9688b5a46efe54f15357096e3e. Change-Id: Id34ff9530a71ce43549e2eb78d2d927084d46a47 Reviewed-on: https://chromium-review.googlesource.com/280915 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 475e5b7f 2015-06-22T13:12:45 D3D11: Reduce overhead of clearing unused textures. We would spend a fair bit of time iterating over the unused textures, setting them to null one-by-one, and updating our cache. We can reduce this time by smarter caching, and skipping unmodified ranges. BUG=angleproject:959 Change-Id: I92f11cf63542c55bb3adbbb8276a54bcfe848f61 Reviewed-on: https://chromium-review.googlesource.com/277118 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross 405f3471 2015-06-04T13:09:06 In D3D11, check for 16-bit texture support and use if possible BUG=angleproject:1002 The last patch added new tests which failed on some Intel Win7 machines. This was due to a driver bug. Windows Updates have been applied to the failing machine, and the tests now pass. Changes between second and current (third) failed 16-bit patch: - Reenable usage of 16-bit DXGI textures on all Intel cards - Disable 16bpp tests on Intel D3D11 until the bots are updated - Updated Win7 test machine. Tests now pass Changes between first and second failed 16-bit patch: - Disabled usage of 16-bit DXGI textures on all Intel cards - Added DXGI->GL conversion entries for 16-bit formats, which fixes FBO readback issues. The ES CTS and dEQP tests which failed with the last patch now pass. Change-Id: Id8ea89bfbc450beea54afdd398956bc97ecf3c01 Reviewed-on: https://chromium-review.googlesource.com/275082 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Geoff Lang 6bef4ff7 2015-06-01T21:08:31 Revert "In D3D11, check for 16-bit texture support and use if possible" Seeing failures on Win7 + Intel machines. Example build: https://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20%28Intel%29/builds/11756 This reverts commit 673115d9cc4251cd690e14a98ef0c717ba9de0b9. Change-Id: Ie2b6cc1ae9c4e83dde3a531e38252c95ac2e2a0a Reviewed-on: https://chromium-review.googlesource.com/274450 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross 673115d9 2015-05-28T09:27:57 In D3D11, check for 16-bit texture support and use if possible BUG=angleproject:1002 Changed since last failed 16-bit patch: - Disabled usage of 16-bit DXGI textures on all Intel cards - Added DXGI->GL conversion entries for 16-bit formats, which fixes FBO readback issues. The ES CTS and dEQP tests which failed with the last patch now pass. Change-Id: Ib66abf73f23dbb4329f0a32d7f3dafbbc23e6c08 Reviewed-on: https://chromium-review.googlesource.com/273712 Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 8e7549bd 2015-05-27T14:05:10 Revert "In D3D11, check for 16-bit texture support and use if possible" Causing failures on Windows 8 bots running ES CTS and Windows 7 Intel bot running angle tests. Example failures: https://build.chromium.org/p/chromium.gpu.fyi/builders/Win8%20Release%20%28NVIDIA%29/builds/14442 https://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20%28Intel%29/builds/11627 This reverts commit d63f08fcc32ea17bac2b025f0ad3261664ff79c9. Change-Id: I841aee5fb0973432f249277126424b909d5b3e17 Reviewed-on: https://chromium-review.googlesource.com/273416 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Austin Kinross d63f08fc 2015-05-21T10:22:04 In D3D11, check for 16-bit texture support and use if possible BUG=angleproject:1002 Change-Id: I36a5ee774b38e9865b2eb6c6789afd316c4eff16 Reviewed-on: https://chromium-review.googlesource.com/272061 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Austin Kinross <aukinros@microsoft.com>
Geoff Lang 831b1953 2015-05-05T11:02:27 Move the IndexRangeCache and Range types to the gl namespace. BUG=angleproject:881 Change-Id: Ib05149facee9fcc7714cb957ca8647b3498a36b6 Reviewed-on: https://chromium-review.googlesource.com/269254 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Brandon Jones <bajones@chromium.org>
Minmin Gong 794e0009 2015-04-07T18:31:54 Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data) Change-Id: Id0e06d7d6600344d858f00dabc219d79289bbc82 Reviewed-on: https://chromium-review.googlesource.com/265020 Tested-by: Minmin Gong <mgong@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b3584fb4 2015-04-09T17:34:21 Revert "Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data)" Causing a build failure on Mac/Clang: ./Tokenizer.cpp:551:7: error: extra tokens at end of #else directive [-Werror,-Wextra-tokens] #else if defined(_MSC_VER) http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/29136 This reverts commit 3b26e231d99154814eb428f75a67bbe7a21adadc. Change-Id: I2d11ddcc18130d908fd2ec3d6f5ab890cfccd5e7 Reviewed-on: https://chromium-review.googlesource.com/264983 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Minmin Gong 3b26e231 2015-04-07T18:31:54 Fix and enable warning C4244 (Conversion from 'type1' to 'type2', possible loss of data) Change-Id: I73d9a2b9ad16f032be974b9c819de0dc1247c2ea Reviewed-on: https://chromium-review.googlesource.com/264533 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang d4475816 2015-03-18T10:53:05 Always use static_assert for compile-time assertions and remove META_ASSERT. BUG=468139 Change-Id: I696ef307f2faa54bb72df66784bc79a055499987 Reviewed-on: https://chromium-review.googlesource.com/260776 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Austin Kinross b8af723d 2015-03-16T22:33:25 Fix and enable warning C4245 (signed/unsigned mismatch) Change-Id: If48043835fcc98341a0626e3ece7d0e3f7958059 Reviewed-on: https://chromium-review.googlesource.com/260630 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cooper Partin <coopp@microsoft.com> Tested-by: Austin Kinross <aukinros@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 3b9bb72b 2015-01-05T16:17:02 Add a cross-platform rotl implementation. The _rotl method is unavailable on any platform but Windows, so we can implement the method ourselves. BUG=angle:773 Change-Id: I1342f4cf8a996daf11a36553c3bf7a01a2b182b3 Reviewed-on: https://chromium-review.googlesource.com/238500 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 0a73dd85 2014-11-19T16:18:08 Fix include guards. BUG=angle:733 Change-Id: I08b2c11c4831f1161c178c1842b10e807185aced Reviewed-on: https://chromium-review.googlesource.com/230831 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez ac6ff938 2014-11-12T06:16:53 Unset SRVs which resource are being bound to an RTV This is the extension of a previously debug-only workaround for D3D doing the unsetting by itself (with a warning). It made our state tracking of the bound SRVs out of sync with D3D's and caused some rendering to not take place. BUG=427245 Change-Id: Id378030b64fddafbb3d406872a7dfd2c84793221 Reviewed-on: https://chromium-review.googlesource.com/229066 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill d46275f9 2014-11-06T13:54:53 Fix platform if defined build error on Linux. Using #if instead of #if defined() was giving an error when ANGLE_PLATFORM_WINDOWS was undefined. Instead of defining it as zero for all platforms, use #if defined() to ensure our legacy usage of #ifdef doesn't get messed up by #define <value> 0. BUG=angle:825 Change-Id: Ibad51c45c4337a30feb68561b6cf54ed5dc05d9d Reviewed-on: https://chromium-review.googlesource.com/228270 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Cooper Partin 88d3b8cb 2014-10-08T10:41:56 Added IInspectable EGLNativeWindowType and ICoreWindow support Change-Id: I6dd7fef72a73572d4a3deda7ce36a11da3a75c81 Reviewed-on: https://chromium-review.googlesource.com/224366 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e020bed5 2014-10-20T16:16:46 Revert "Added IInspectable EGLNativeWindowType and ICoreWindow support" Causing regressions in the build: http://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder/builds/20182 This reverts commit 756aebfc7afa6d0de14e96637ef396dd7b290c2d. Change-Id: I2f4bdb5aeb429c9bbc5e655a1761704f33737841 Reviewed-on: https://chromium-review.googlesource.com/224221 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin 756aebfc 2014-10-08T10:41:56 Added IInspectable EGLNativeWindowType and ICoreWindow support Change-Id: I34e443b1e194800460e441ac6cee42cf68430564 Reviewed-on: https://chromium-review.googlesource.com/224302 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Shannon Woods 8858cf0a 2014-10-17T20:53:32 Revert "Added IInspectable EGLNativeWindowType and ICoreWindow support" due to build failures on Chromium FYI bots. This reverts commit 406a3be91cc8175df95bd390425e35830778f2d5. Change-Id: Ica2abd2e557a4fd9852d85b7fc018e3d272b6edf Reviewed-on: https://chromium-review.googlesource.com/224051 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Shannon Woods <shannonwoods@chromium.org>
Cooper Partin 406a3be9 2014-10-08T10:41:56 Added IInspectable EGLNativeWindowType and ICoreWindow support Change-Id: I9ad82b7819bcca1c05e7aa60dc2baec4a7bc403c Reviewed-on: https://chromium-review.googlesource.com/222360 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Geoff Lang <geofflang@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>
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>
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 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>
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 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>
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>