src/common


Log

Author Commit Date CI Message
Luc Ferron 41918387 2018-03-13T11:37:54 Vulkan: Additional texture formats support. RGB565, RGBA4444, RGBA5551 Bug:angleproject:2358 Change-Id: I4dc19f9e4cc7b51f215b57d440a108cdf17aec24 Reviewed-on: https://chromium-review.googlesource.com/960573 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Lingfeng Yang dbb9c534 2018-02-25T19:58:24 GLES1: state: Define / initialize GLES1-specific states Contains definitions of GLES1-specific states such as material / lighting. Tweaked the Color class for easier copying to uniforms / reading as a float array. This CL also adds the GLES1-specific state in GLES1State, which is then part of the State class and is initialized to the spec's values if the context major version is ES 1. + Some clang-format BUG=angleproject:2306 Change-Id: I7fc3bd9a22ebf0ffcd98d931d0176f21e17b1c5c Reviewed-on: https://chromium-review.googlesource.com/936424 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 99d492c2 2018-02-27T15:17:10 Use packed enums for the texture types and targets, part 2 This completes the refactor by using the packed enums in the gl:: layer and in the backends. The packed enum code generation is modified to support explicitly assigning values to the packed enums so that the TextureTarget cube map faces are in the correct order and easy to iterate over. BUG=angleproject:2169 Change-Id: I5903235e684ccf382e92a8a1e10c5c85b4b16a04 Reviewed-on: https://chromium-review.googlesource.com/939994 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez f0e89be6 2017-11-08T14:00:32 Use packed enums for the texture types and targets, part 1 In OpenGL there are two enum "sets" used by the API that are very similar: texture types (or bind point) and texture targets. They only differ in that texture types have GL_TEXTURE_CUBEMAP and target have GL_TEXTURE_CUBEMAP_[POSITIVE|NEGATIVE]_[X|Y|Z]. This is a problem because in ANGLE we use GLenum to pass around both types of data, making it difficult to know which of type and target a variable is. In addition these enums are placed somewhat randomly in the space of OpenGL enums, making it slow to have a mapping from texture types to some data. Such a mapping is in hot-code with gl::State::mTextures. This commit stack makes the texture types and target enums be translated to internal packed enums right at the OpenGL entry point and used throughout ANGLE to have type safety and performance gains. This is the first of two commit which does the refactor for all of the validation and stops inside gl::Context. This was the best place to split patches without having many conversions from packed enums to GL enums. BUG=angleproject:2169 Change-Id: Ib43da7e71c253bd9fe210fb0ec0de61bc286e6d3 Reviewed-on: https://chromium-review.googlesource.com/758835 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jeff Gilbert ad661940 2018-02-22T18:15:45 Remove unused include of math.h in matrix_utils.h. BUG=angleproject:2366 Change-Id: Ic398da0b86caef577140808a87fcc2e74ed28dc0 Reviewed-on: https://chromium-review.googlesource.com/935144 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Nico Weber b5db2b49 2018-02-12T15:31:56 Enable -Wimplicit-fallthrough for ANGLE. Also teach MSVC that ANGLE_CRASH() can't return. Also fix instances of the warning in build configurations where UNREACHABLE() can return (e.g. release without dcheck_always_on or debug). If the UNREACHABLE()s are truly unreachable, this change has no behavior change. Bug: chromium:810767 Change-Id: I68f3587cf3e268c3ef634dce7ae3d70399859d0f Reviewed-on: https://chromium-review.googlesource.com/914842 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Nico Weber <thakis@chromium.org>
shinchiro 0bc6024a 2018-02-09T22:03:49 Fix mingw compile. Adjust a compile guard around posix_memalign. Bug: angleproject:2163 Change-Id: I1d2dca24b8a2b8e549df411b1611e9fe0ac9082d Reviewed-on: https://chromium-review.googlesource.com/920748 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Lingfeng Yang 710aa5c7 2018-02-08T10:57:55 GLES1: Mat4 transform library GLES1 has functions like glFrustum / glTranslatef which are baked 4x4 matrix operations. The purpose of this CL is to add those operations as library functions in ANGLE, to make it convenient later on. This is inspired by GLM and tested against GLM-generated numbers. BUG=angleproject:2306 Change-Id: I3b428a115a935ee4f0d00585ad38745a38cc128c Reviewed-on: https://chromium-review.googlesource.com/909578 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 7b17fa18 2018-01-29T11:12:57 Add a constexpr constructor for TVariable BUG=angleproject:2267 TEST=angle_unittests Change-Id: I9b7e01801caa7235ac5e2d4212ea92e38c1f774d Reviewed-on: https://chromium-review.googlesource.com/908752 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
jchen10 046fa0ef 2018-02-02T14:51:36 Vulkan: Prepend layer path to VK_LAYER_PATH Directly setting this variable overwrites old value, as might be unexpected. Instead the path can be prepended to it, so that old value can still work. This is needed in order to use additional debugging layers, like the "api_dump" layer. See https://github.com/LunarG/VulkanTools for more. BUG=angleproject:2333 Change-Id: I5338a5b928ffa792cc9b6db5b69713320b5b0842 Reviewed-on: https://chromium-review.googlesource.com/898591 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Nico Weber 41b072b6 2018-02-09T10:01:32 Prepare for -Wimplicit-fallthrough in ANGLE. Disable the warning for flex-generated output, which contains lots of intentional fallthrough. Fixes a bug where GL_SAMPLE_ALPHA_TO_ONE_EXT would fall through to GL_COVERAGE_MODULATION_CHROMIUM and hence behave like that. Fixes a bug in the D3D9 state management where invalidating DIRTY_BIT_POLYGON_OFFSET would also invalidate the stencil bits. One somewhat common incorrect pattern in ANGLE is nested switch statements that look like so: switch (a) { case a1: switch (b) { case b1: ... break; } case a2: ... } The assumption here seems to be that the breakk exits the outer case (here a1), while it in fact only exits the inner switch, so that we fall through to a2. In most places, I fixed this by adding an explicit `break` after the inner switch. This fixes a bug wher GL_PATH_JOIN_STYLE_CHROMIUM would fall through to GL_PATH_MITER_LIMIT_CHROMIUM in validation (but since the join style enum is always > 0, this happened to not have an effect in practice). This also fixes 87 bugs in GetLoadFunctionsMap() where invalid values would previously return an unrelated function map instead of the empty load function map. Bug: chromium:810767 Change-Id: Ib51388c73fbfc229160e2c10f8fb9364cc7c996c Reviewed-on: https://chromium-review.googlesource.com/911529 Commit-Queue: Nico Weber <thakis@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Wez ca5c1059 2018-02-05T19:21:11 Replace a POSIX API call not supported by Fuchsia. Bug: chromium:809201 Change-Id: Iafc2e7efe92bcb977e5185901c073e499114a9f4 Reviewed-on: https://chromium-review.googlesource.com/903261 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 6807f826 2018-01-25T20:19:27 Print more logs when using default Platform Some logs prior to Test Platform initialization were getting lost. 1. Also print WARN() to stdout 2. Use Android specific logging facilities BUG=angleproject:1660 Change-Id: I8424958426809567396ef24cedc2d427a3a21959 Reviewed-on: https://chromium-review.googlesource.com/887944 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Olli Etuaho d66e1939 2018-01-17T11:36:24 Allow creating EGL pbuffers from typeless D3D textures A new extension EGL_ANGLE_d3d_typeless_texture_client_buffer is added that allows creating EGL pbuffers from typeless D3D textures. The extension increases the flexibility of the API compared to plain EGL_ANGLE_D3D_texture_client_buffer. The colorspace for the created EGL pbuffer can be set by using the EGL_GL_COLORSPACE attribute. Internally this sets the ANGLE format of the buffer. There are new ANGLE formats that are used specifically for typeless textures, separate ones for SRGB and linear views into the D3D textures. The extension is only supported on the D3D11 backend of ANGLE. BUG=angleproject:2300 TEST=angle_white_box_tests Change-Id: I6a6cb873d2cc0dca0b7f18a0f2cd35e7bafcb7d8 Reviewed-on: https://chromium-review.googlesource.com/873917 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Frank Henigman f661686c 2018-01-15T23:49:14 Fix gyp/gcc build. Gcc complains about an unused variable. Adjust a #include to work with the gyp build. BUG=none Change-Id: Ia94abf70f3a9bb7952eb53d1f0a3cfcca5df0836 Reviewed-on: https://chromium-review.googlesource.com/867655 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 2cc2a727 2018-01-09T17:21:54 common: Add aligned memory allocator. This will be useful for the Vulkan pipeline state cache. This cache wants to pack the pipeline description very carefully into a specific number of bits, using the "alignas" keyword. Using this keyword requires an aligned allocator, which we can lift from Chromium's base/memory submodule. Also includes a unittest copied from Chrome. Bug: angleproject:2163 Change-Id: I25976be4610636db3f43552bba23d823f5a49a24 Reviewed-on: https://chromium-review.googlesource.com/837944 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill eeda03b6 2018-01-05T17:26:29 EGL: Remove internal enum for NULL driver. This is now updated in Chrome, so we can remove the last uses. Bug: angleproject:2159 Change-Id: Ia31e42b8a685756ee70450be19a52248e3efa92f Reviewed-on: https://chromium-review.googlesource.com/853119 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f3e23295 2018-01-04T18:19:21 EGL: Expose NULL driver device selection. This makes the device type selection part of the ANGLE platform extension. We currently support NULL driver selection on all available back-ends (although on the NULL back-end, it already has no device type). Optionally we could expose certain features of this as separate extensions. This currently also supports the old hidden enum, until we can update Chrome and consolidate to the new exposed official enum. Bug: angleproject:2159 Change-Id: I85d0811098e644e8192c207673af9e18ed7c1da2 Reviewed-on: https://chromium-review.googlesource.com/846021 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Xinghua Cao 26143fdd 2017-11-01T18:19:05 ES31: Support bindImageTexture on Texture2D for compute shaders on D3D BUG=angleproject:1987 TEST=angle_end2end_tests Change-Id: I3b0afb441a41dbd7f204b1d1bba7884c8d203ce1 Reviewed-on: https://chromium-review.googlesource.com/749004 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 8225e73b 2017-11-14T16:29:03 Support struct varying for transform feedback Capturing struct members is vague In ES 3.00. But the ES 3.10 explicitly says that base-level members of struct are feasible for transform feedback capture. This implementation fills the gap. TEST=angle_end2end_tests:TrasnformFeedbackTest* BUG=angleproject:2241 Change-Id: Ibdf3ae6c2b8b28952e2f7fef1363545cbccad389 Reviewed-on: https://chromium-review.googlesource.com/768613 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 9db70de8 2017-07-04T18:28:42 Reland: Implement EGL_ANGLE_iosurface_client_buffer Includes a fix for creating pbuffers with <buftype> EGL_D3D_TEXTURE with EGL_WIDTH and EGL_HEIGHT attributes. BUG=angleproject:1649 TBR=geofflang@chromium.org Change-Id: Id2974b8fab02c3218febfac708b9b034e65cbc53 Reviewed-on: https://chromium-review.googlesource.com/823248 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 7f5c3eb7 2017-12-12T14:54:17 Revert "Implement EGL_ANGLE_iosurface_client_buffer" This reverts commit c7abc08034a30a41748eefc5b628a76d4e2daa8a. Reason for revert: Might have broken Chromium Win10 composition due to validation changes. Original change's description: > Implement EGL_ANGLE_iosurface_client_buffer > > BUG=angleproject:1649 > > Change-Id: I1e72c31d7c9497ad14039a8d3fb97317ab193cb2 > Reviewed-on: https://chromium-review.googlesource.com/559107 > Reviewed-by: Corentin Wallez <cwallez@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Corentin Wallez <cwallez@chromium.org> TBR=geofflang@chromium.org,cwallez@chromium.org Change-Id: I605b710b6d76056d6276b09822cd6ddca277bfd0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:1649 Reviewed-on: https://chromium-review.googlesource.com/822172 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez c7abc080 2017-07-04T18:28:42 Implement EGL_ANGLE_iosurface_client_buffer BUG=angleproject:1649 Change-Id: I1e72c31d7c9497ad14039a8d3fb97317ab193cb2 Reviewed-on: https://chromium-review.googlesource.com/559107 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez e4477001 2017-12-01T14:39:58 Add PackedEnumBitSet, use it for buffer binding validation Includes angle::BitSetT changes from jmadill@chromium.org BUG=angleproject:2169 Change-Id: I9f896613f5c6cdc91281cb9a00134f67291870d9 Reviewed-on: https://chromium-review.googlesource.com/804177 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 4fba4a97 2017-12-05T10:36:05 Include the D3D11 headers on Windows when OpenGL is enabled. The OpenGL backend on Windows uses D3D11 to implement several interop extensions. Without this change, there are compile failures when the D3D11 backend is disabled. BUG=angleproject:2276 Change-Id: I69ad524ca84aa0aa399cfc0b601315f3ee65ed16 Reviewed-on: https://chromium-review.googlesource.com/809186 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 465835d6 2017-09-26T13:34:10 Support arrays of arrays in the API The ShaderVariable class that is used as an interface between the compiler and the rest of the code gets arrays of arrays support. Array of array variables are passed from the compiler just like any other variables. However, when stored in Program state each innermost array constitutes a separate variable. This is done to make the implementation match the GLES specification for program interface query APIs. This will be tested more fully once support for parsing arrays of arrays lands in the compiler. TEST=angle_end2end_tests, angle_unittests BUG=angleproject:2125 Change-Id: I0f7159000f039be92a87a52b3b68cd9a215a21cb Reviewed-on: https://chromium-review.googlesource.com/684742 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8957b6c0 2017-11-14T12:40:38 Add perf test for ushort DrawElements. The code path in the D3D11 back-end is sigificantly different for unsigned short indices vs unsigned int. Because of the workaround we have for the primitive restart index in D3D11, ushort rendering can be slower. BUG=angleproject:2229 Change-Id: I303dcc55b0314ec45508044995ba47b250cbb87d Reviewed-on: https://chromium-review.googlesource.com/767149 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Bryan Bernhart (Intel Americas Inc) f4f293ef 2017-11-06T15:56:29 Harden uniform array index parsing. Add overflow handling when parsing uniform variables. BUG=angleproject:2191 TEST=angle_unittests Change-Id: Ib2a69be1cc11a94420bc923a2aaaef8dc664d562 Reviewed-on: https://chromium-review.googlesource.com/756209 Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Tom Anderson 23cd4add 2017-11-10T14:54:37 Add missing include to stddef.h on arm Change-Id: I28771a550a3188993635f55803093fc49590ceb1 Reviewed-on: https://chromium-review.googlesource.com/764887 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang ee6884e7 2017-11-09T16:51:11 Generate generic error messages for Error objects without messages. Makes sure that the debug output is fired for all generated errors. BUG=783054 Change-Id: Ia30870cd950c53da892554e0862276d4be5360ac Reviewed-on: https://chromium-review.googlesource.com/761760 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Antoine Labour <piman@chromium.org>
Sami Väisänen 935cb7c5 2017-11-08T15:53:41 Support B8G8R8A8_UNORM_SRGB as D3D11 texture format Support B8G8R8A8_UNORM_SRGB as D3D11 texture format. BUG=angleproject:2172 Change-Id: I2f15a55123601735d7fc6caa40bb056243a91b44 Reviewed-on: https://chromium-review.googlesource.com/758600 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jeff Gilbert 5e5438fe 2017-10-31T14:44:06 Make operator bool() explicit, and remove explicit from move ctors. Gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1371190 BUG=angleproject:2211 Change-Id: I10b866728a844668de6373c3a0968ea4e8256ff7 Reviewed-on: https://chromium-review.googlesource.com/747841 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho d255123c 2017-10-26T20:03:33 Store shader interface variables as per query spec GLES 3.1 section 7.3.1.1 specifies how active variable entries should be generated and how active variables are named. The specs for program interface variable queries are built on top of this section. ANGLE has already followed this spec for the most part for generating variable lists in ProgramState, but now we also follow the naming spec for arrays and include [0] at the end of the stored name. This will make implementing arrays of arrays more straightforward. Most logic for variable queries will just keep working as is when arrays of arrays are added instead of needing more complex logic for handling array indexing. BUG=angleproject:2125 TEST=angle_end2end_tests Change-Id: I3acd14253153e10bc312114b0303065da2efb506 Reviewed-on: https://chromium-review.googlesource.com/739826 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill e7c5f4f0 2017-10-30T07:16:43 Fix compilation on mips devices. We need to include stddef explicity for size_t. BUG=angleproject:2167 Change-Id: I66e75b8d29e94aa9b8427e39827a0267649bb0ec Reviewed-on: https://chromium-review.googlesource.com/743702 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 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>
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>
Jamie Madill 22d7f1f3 2017-10-12T16:29:16 Simplify uniform type table texture type. We can use Python's "endswith" more easily than using the current checks. BUG=angleproject:1390 BUG=angleproject:2167 Change-Id: I5a35602c91b989270cff1d42a9d5ede542039fbd Reviewed-on: https://chromium-review.googlesource.com/717188 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d92e93b8 2017-10-11T14:28:34 Fix uniform type info for multisample textures. The way that the strings were generated was erroneously marking 2D multisample textures as "2D" instead of "2D_MULTISAMPLE". Fix this by changing how the types are parsed and generated. Fixes incomplete texture handling of 2D multisample textures. BUG=angleproject:1390 BUG=angleproject:2167 Change-Id: I8ffffca119cc7ca654ed1fe81cba37b758f9ef9f Reviewed-on: https://chromium-review.googlesource.com/713585 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@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>
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>
Jamie Madill 6276b922 2017-09-25T02:35:57 Vulkan: Implement basic uniform shader parsing. This is a first step at implementing uniforms with descriptor sets. It does not actually bind uniforms and upload data, but it does implement uniform shader parsing. Uniforms are gathered into a single uniform block which is bound to set 0, with binding 0 for vertex uniforms and binding 1 for fragment uniforms. Also adds a ReplaceSubstring helper to string_utils. Also removes the precision writing from OutputVulkanGLSL since this was generating warnings with glslang. BUG=angleproject:2167 Change-Id: I9ec8351ec1973e583100f99292b0080ee968067b Reviewed-on: https://chromium-review.googlesource.com/699938 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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>
Kai Ninomiya 8c5b69cb 2017-09-18T20:23:08 Replace MurmurHash3 with PMurHash PMurHash comes from the smhasher repository at chromium/src/third_party/smhasher Bug: 697758 Change-Id: Id2859edf37ae66bf27509d53db7f22db8831fe44 Reviewed-on: https://chromium-review.googlesource.com/687970 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 457ded9b 2017-09-22T16:58:44 Print FILE in more debug info messages. Applies to UNREACHABLE and UNIMPLEMENTED. This helps track down the offending line more easily. BUG=angleproject:2167 Change-Id: I97eb80677a6dd432a04f5e7516c3db3de8e7128a Reviewed-on: https://chromium-review.googlesource.com/679999 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill b8bbbf9e 2017-09-19T00:24:59 Vulkan: Use environment override to load layers. Instead of using a compile-time define, use an OS call to override the environment variable the loader uses to look for layers. This should allow us to have a run-time override mechanism, so we can more easily use ANGLE with RenderDoc and other tools that hook into the layers for debugging and profiling purposes. This should also allow the developer to install and use their own layers with ANGLE if desired. This patch removes the angle_loader.h generation since it is no longer necessary. It also fixes an unrelated loader warning that occured when releasing the current pipeline object. BUG=angleproject:1898 Change-Id: Ic4a5120a6b73745397451ef9e3897e157da1feda Reviewed-on: https://chromium-review.googlesource.com/671490 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Kai Ninomiya 8b2142e3 2017-09-18T13:17:13 Put MurmurHash3 functions in the angle namespace To prevent collisions when linking with other copies of MurmurHash3. BUG=697758 Change-Id: Id8a5c709ba972812ffa3ca143e7553cbf05fc57a Reviewed-on: https://chromium-review.googlesource.com/671194 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 71c88b31 2017-09-14T22:20:29 Enable [[nodiscard]] for gl::Error. This forces all return values to be checked for gl::Error. Requires quite a bit of minor refactoring. I also added a macro to swallow an error without returning from a function. We could look at storing the errors in the Context at some point, since almost always when we're generating errors that we need to discard we have access to the Context as a parameter. BUG=angleproject:2150 Change-Id: I457e48a30c002eda0993acbcd3180ba87bf169fb Reviewed-on: https://chromium-review.googlesource.com/665173 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
jchen10 d9cd7b7f 2017-08-30T15:04:25 ES31: Add glGetProgramInterfaceiv API Add API entry and validation checks(GLES 3.1 section 7.3). Add the first 4 interfaces(PROGRAM_INPUT, PROGRAM_OUTPUT, UNIFORM and UNIFORM_BLOCK) implementation. BUG=angleproject:1920 TEST=angle_end2end_tests:ProgramInterfaceTestES31.* Change-Id: Iab80ba332e2a5e2b3e677039359e60a420e3d6b0 Reviewed-on: https://chromium-review.googlesource.com/642729 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a9459dbc 2017-09-09T23:32:52 Fix EXTERNAL and 2D_ARRAY sampler type info. The type info tables were incorrectly using some information. This bug was uncovered after trying to use the tables more. BUG=angleproject:1390 Change-Id: I5eae01f51269bab05746a14bd3caabb614be210a Reviewed-on: https://chromium-review.googlesource.com/659220 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ef97c613 2017-09-09T23:34:18 Roll GYP for VS2017 project support. Also includes a ToLower string helper for a VS2017 warning fix. https://chromium.googlesource.com/external/gyp.git/+log/aae1e3efb50786df2..c6f471687407bf28d BUG=angleproject:1569 Change-Id: Iaf8a091a24d937db3adb242f05c8a5c9d2b03b0f Reviewed-on: https://chromium-review.googlesource.com/659219 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Martin Radev 74a0000f 2017-07-11T11:27:09 Request a D3D11.1 device and D3D11.3 context The patch extends Renderer11 so that a D3D11.1 device and D3D11.3 context can be created. This is necessary for using the D3D11.3 feature called VPAndRTArrayIndexFromAnyShaderFeedingRasterizer. BUG=angleproject:2062 BUG=angleproject:2145 TEST=angle_end2end_tests Change-Id: I84c761b2897d7d911686f5b6d79cb93e233015a0 Reviewed-on: https://chromium-review.googlesource.com/591448 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 6ab833ad 2017-09-01T16:37:53 Add more comparators to Optional.h. BUG=angleproject:1387 Change-Id: If3fc67f99716b2e5e6a8b0ffd139a07a06cdcab8 Reviewed-on: https://chromium-review.googlesource.com/648050 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f00f7ffe 2017-08-31T14:39:15 Add a Uniform type info table. Currently most uniform type info is determined by switching on the uniform type. Some values are computed from other values, which can result in three or more switch statements plus some multiplies or other math. This patch attempts to improve the speed by pre computing necessary values into constant static tables. Improves performance by about 7% in a uniform stress test. BUG=angleproject:1390 Change-Id: I29bef259a17f6d6536171ade4950e2d712bfd39c Reviewed-on: https://chromium-review.googlesource.com/643791 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2c1183bb 2017-08-24T10:36:01 Fix compile on non C++14 configs. The WrappedArray move constructor was not contexpr under c++11 rules. New code was introduced when fixing D3D11 runtime warnings. BUG=angleproject:2025 Change-Id: Ie322d9fa3db36f320b7a9ef5048a23c31c153ad1 Reviewed-on: https://chromium-review.googlesource.com/633911 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 92996b0d 2017-08-17T10:39:02 D3D11: Fix masked clear unused RTV warning. This benign warning would show up in the Debug layer messages. It was causing the test to fail in some standalone configurations. This fix implemented here is to keep 8 different pixel shaders, one for each total count of render targets, up to the implementation max. BUG=angleproject:2025 Change-Id: I826ddae686ddb1cfad17879644152be2f6125c5b Reviewed-on: https://chromium-review.googlesource.com/617512 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang aadc8f37 2017-08-11T17:34:44 Implement the CPU fallback for CopyTextureCHROMIUM on OpenGL. BUG=angleproject:1932 Change-Id: Iabc1a3e361d66313dc16bf19b392402b7836f8a5 Reviewed-on: https://chromium-review.googlesource.com/612562 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
jchen10 3c76d59f 2017-08-03T08:47:56 Check GCC for __has_attribute The __has_attribute macro was one of improvements in GCC 5 release. See https://gcc.gnu.org/gcc-5/changes.html. This checks to make it work with older GCC. BUG=angleproject:2119 Change-Id: I751249b9d028d1322829bebc1ca8d423edf27057 Reviewed-on: https://chromium-review.googlesource.com/599152 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 13c0dd46 2017-07-04T18:27:01 Add texture rectangle extension. This is needed to support binding IOSurfaces to textures on OSX. This commit adds support in the API and tests, but didn't need to implement compiler changes as it already supported ARB_texture_rectangle. Implementation of CHROMIUM_opy_texture for rectangle texture and the spec are left for follow-up commits. Change-Id: I45c66be763a9d3f6f619640f9f95f39b05c70867 Reviewed-on: https://chromium-review.googlesource.com/559106 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 44183cce 2017-08-01T12:48:34 Micro-optimizations to draw call entry point. Thanks to Markus from NVIDIA. This inlines some methods and optimizes the check if a uniform is a bool type. BUG=angleproject:2119 Change-Id: I6f2c2d22c577458b39de600d3c56ec8e1a456a7a Reviewed-on: https://chromium-review.googlesource.com/591699 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
jchen10 05c31dae 2017-07-18T16:11:39 ES31: Enable atomic counter for GL backend This simply translates the offset qualifier and synchronizes the buffer binding state for GL translator and renderer. BUG=angleproject:1729 TEST=angle_end2end_tests:AtomicCounterBufferTest31 Change-Id: Ib8424918478ae4c47049d5856ea20ef022f12913 Reviewed-on: https://chromium-review.googlesource.com/575913 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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>
Jamie Madill b3f26b9e 2017-07-19T15:07:41 Add a zero-filled scratch buffer to Context. We need this in a few places for handling resource init. Centralize this in the context so we don't have to recreate and re-fill a large zero buffer. BUG=angleproject:2107 Change-Id: Icf9ce417e7ee3498f03e47741dfff89e81b49519 Reviewed-on: https://chromium-review.googlesource.com/576057 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9c335865 2017-07-18T11:51:38 Refactor StateManager11 for dirty bits. This will make iterating over an internal set of dirty bits simpler. This also reorganizes the framebuffer invalidation logic a bit, including how the sample count is pulled from the Framebuffer. BUG=angleproject:1156 Change-Id: I79dbcd11704ab52568c587d836af9c1bff1d2d1f Reviewed-on: https://chromium-review.googlesource.com/529708 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jerome Duval d2e87929 2017-07-12T15:42:34 Enable Haiku in platform-specific headers. 1. src/common/platform.h updated to define ANGLE_PLATFORM_POSIX on Haiku. 2. include/EGL/eglplatform.h updated to add stubs typedefs for platform-specific primitives for Haiku. Change-Id: I28775e909ad9cabec1c474ff4fe0a241eb05d6a1 Reviewed-on: https://chromium-review.googlesource.com/573022 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Sergey Ulanov 145e3cbb 2017-06-29T12:36:21 Enable Fuchsia in platform-specific headers. Two simple fixes to make libANGLE compile for Fuchsia: 1. Added stubs typedefs for platform-specific primitives in EGL/eglplatform.h for Fuchsia. 2. src/common/platform.h updated to define ANGLE_PLATFORM_POSIX on Fuchsia. Change-Id: I5f053de46632ac3f12bb93e57eeb94c3a34c867c Reviewed-on: https://chromium-review.googlesource.com/563758 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 3244736a 2017-06-28T14:53:52 Use MemoryProgramCache. Add the member functions for saving and loading from the binary cache, and hook them into the Program class. Requires that the Renderer supports the program binary extension. BUG=angleproject:1897 Change-Id: I2dc8d21b02da705ded58c5cd1943562c9c97c49b Reviewed-on: https://chromium-review.googlesource.com/522874 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 13b49757 2017-06-28T13:34:57 Add base SHA-1 routines. We will need these to implement a more secure version of hashing for the program binary cache. These versions of lightly modified from the Chrome versions to make compilation simpler. BUG=angleproject:1897 Change-Id: Ibcadb56c2316e3f39655a07fa28b5fbd6103e452 Reviewed-on: https://chromium-review.googlesource.com/550000 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill fe54834f 2017-06-19T11:13:24 Proliferate gl::Context. This enables a few small things: it will enable making the platform a property of the Display rather than a global. The same goes for the global logging annotator. Also it ensures all back-end implementations have access to the GL / EGL state when available. Also introduces a smart pointer helper class to angleutils for objects that prefer to be destroyed with a context (gl::Context/egl::Display) parameter. We were using std::unique_ptr in a few places that would not work well with these objects. BUG=angleproject:1156 Change-Id: I59e288a3d6f766ff8a0f4b48ff3a1fbf7489daba Reviewed-on: https://chromium-review.googlesource.com/529706 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 8d471f90 2017-06-13T16:05:35 Make distinct header guards for anglebase. BUG=angleproject:2065 Change-Id: I7783d4866a2e16e0cee79aecccb6d5ee1b74165d Reviewed-on: https://chromium-review.googlesource.com/533724 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Kai Ninomiya 0492d447 2017-06-07T13:45:15 Move murmurhash to src/common/third_party Bug: chromium:697758 Change-Id: I8a3a990b14cde0fdd45319d593040bfc571abf3e Reviewed-on: https://chromium-review.googlesource.com/527602 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 4cdac9eb 2017-05-08T11:01:20 ES31: Add atomic counter for GLSL parsing This makes shader compiler support the new basic type 'atomic_uint' and validate its layout qualifiers properly. BUG=angleproject:1729 TEST=angle_unittests:AtomicCounterTest angle_deqp_gles31_tests:dEQP-GLES31.functional.atomic_counter.layout.invalid* angle_deqp_gles31_tests:dEQP-GLES31.functional.debug.negative_coverage.*.atomic* Change-Id: Ia237eadf6ea72314f436a0abbb93a05598e71eba Reviewed-on: https://chromium-review.googlesource.com/500088 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Yuly Novikov c4d18aac 2017-03-09T18:45:02 Use ErrorStream everywhere Eliminates one more usage of FormatString and its static initializer. Add more ErrorStream types and replace gl::Error and egl::Error with them. BUG=angleproject:1644 Change-Id: Ib498d0ae4b81a332ec71aed7cf709993b154e6bb Reviewed-on: https://chromium-review.googlesource.com/505429 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 93a540fc 2017-06-05T14:26:47 D3D11: Reset the TF binding offsets when glBeginTransformFeedback is called. BUG=angleproject:2051 Change-Id: I09e8548ef76b7d824743d06b0bba21633bc40a24 Reviewed-on: https://chromium-review.googlesource.com/523671 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 5978e28d 2017-06-02T11:49:31 D3D11: Consolidate InputLayout allocation. This introduces a helper type to act as the initialization data type for input element arrays. A WrappedArray class acts as a helper class to wrap a C array and size into a C++ class, similar to std::array but without the data storage. Also move resource deallocation memory counting into a single code path. BUG=angleproject:2034 Change-Id: I5e108254777f0df65f5f60fe26e760c71b95b542 Reviewed-on: https://chromium-review.googlesource.com/506775 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 98de826c 2017-05-29T13:01:02 Platform: Fix initialization order in tests. Because of the platform refactor in abf38572062b91 we broke the way the tests override the D3D workarounds for the tiny depth/stencil bug. This change passes a pointer to the platform directly in the EGL init logic, which solves this issue. It also removes all decltype code in the platform header which might fix the UBSAN problem we were seeing previously. Also change a present mode selection error into a warning in the Vk back-end, since this was being triggered on AMD, but is safe. BUG=angleproject:2042 Change-Id: Ibbd0c69ce11a840cf4b33c616f56020001e553aa Reviewed-on: https://chromium-review.googlesource.com/513519 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 4f0e003e 2017-05-01T16:04:35 Implement the new formats/features of the ES3 CHROMIUM_copy_texture. Some non-renderable texture formats remain unimplemented. BUG=angleproject:1932 Change-Id: Id206432d6e26a70fc0e84478a4e43e9eefadcf2f Reviewed-on: https://chromium-review.googlesource.com/491948 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Lei Zhang 22717ce2 2017-05-24T00:15:22 Wrap safe numerics library in namespace angle. When ANGLE is used with Chromium, having two copies of safe numerics code in namespace base causes ODR violations. BUG=449754 Change-Id: I686049e7d8926373d00dd17ec8142fa3c508b9c5 Reviewed-on: https://chromium-review.googlesource.com/513434 Reviewed-by: Jamie Madill <jmadill@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 44653302 2017-05-17T11:03:44 Use fprintf(stderr) instead of std::cerr. This allows us to include <ostream> instead of <iostream> to avoid including a static initializer. BUG=angleproject:2037 Change-Id: Ib7e84a15018fa951bad1c87ffec4bfb0c896749f Reviewed-on: https://chromium-review.googlesource.com/507627 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 231c7f56 2017-04-26T13:45:37 Apply clang-format to many files. This cleans up the formatting in many places. BUG=None Change-Id: I6c6652ebc042f1f0ffecced53582d09d66b4f384 Reviewed-on: https://chromium-review.googlesource.com/487884 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman aa7203ef 2017-05-03T23:32:29 Inherit privately from angle::NonCopyable. Make all inheritance from angle::NonCopyable private so the compiler complains about this (admittedly unlikely) code: class Foo: angle::NonCopyable { virtual ~Foo() { ... } }; angle::NonCopyable *p = new Foo; delete p; In the above code ~Foo() is not called, only ~NonCopyable(), because the latter is not virtual. Making it virtual would add overhead to all derived classes which don't already have a virtual method. Also tighten access in NonCopyable, because we can. BUG=angleproject:2026 Change-Id: Id0dc4d959cfb7bb82cf49382118129abb1d3a4f0 Reviewed-on: https://chromium-review.googlesource.com/495352 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Shao 37219c87 2017-04-26T10:59:48 Fix missing return values in bitset_utils.h This patch adds the missing return value *this in the operator= of class BitSetT BUG=angleproject:1814 Change-Id: I758d62e80e4ade92aac64315f1808ca1eabdc787 Reviewed-on: https://chromium-review.googlesource.com/487423 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9c9b40ac 2017-04-26T16:31:57 Use parameter cache to skip passing IndexRange. For DrawElements et al., we can use a simple design to store entry point parameters and compute index ranges lazily. This allows us to compute the index range outside of the validation layer. Fixing this will let us implement a few things, such as the no error extension. It will also allow auto-generation of the entry points, since we won't have to have special cases for certain entry points. It will also help fix the syncState layering problem. Now the cached parameter helper (which is owned by the Context) can make the impl layer calls, instead of the validation layer calling the impl directly. We use a small array in Context to gather parameters in a generic way without reallocation on call. We also check type safety by storing a type info struct which can handle inheritance between type classes. Optional variables for the cache determine when to re-compute values. The intent with gatherParams is to call this in every entry point, and have in most cases be a no-op. In some cases like for IndexRange, we store some parameters for later use. The inheritance scheme enables auto-generation of the entry points by keeping signatures similar. BUG=angleproject:747 Change-Id: I871e99e1334cf6e61ef8da62fde3ced094903f8a Reviewed-on: https://chromium-review.googlesource.com/474119 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Frank Henigman 29f148b0 2016-11-23T21:05:36 Support Vulkan on Linux as well as Windows. Refactor display and surface classes into Win32 and Linux parts and add Linux parts to gn and gyp builds. BUG=angleproject:1668 Change-Id: I2a7d29c35f4f42fa0035bd97938d3770f3627672 Reviewed-on: https://chromium-review.googlesource.com/412426 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Yunchao He d7297bfb 2017-04-19T15:27:10 Code refactoring: replace NULL by nullptr for pointers. This is the frist change to replace NULL by nullptr. It handles the initialization and assignment for pointers. BUG=angleproject:2001 Change-Id: I6d4bb198a72e38b867cd2f65a6e6f2f61339a0b5 Reviewed-on: https://chromium-review.googlesource.com/481600 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@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>
Jamie Madill 20e005b2 2017-04-07T14:19:22 Rename BitSetIterator.h to bitset_utils.h BUG=angleproject:1814 Change-Id: I152ae13b6b7cf0ba72259967f0f124e199b20e07 Reviewed-on: https://chromium-review.googlesource.com/471826 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
jchen10 15015f7f 2017-03-16T13:54:21 ES31: Add glGetProgramResourceIndex API Add API entry and validation checks(GLES 3.1 section 7.3). Add the first 2 interfaces(PROGRAM_INPUT and PROGRAM_OUTPUT) implementation. BUG=angleproject:1920 Change-Id: Ib2dedded9fd79b315e9f38de7c27a5e4ec4c6066 Reviewed-on: https://chromium-review.googlesource.com/453085 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 9f9b1d2d 2017-03-06T18:25:22 Make ScratchBuffer its own type. This helper tool in Renderer11 can be useful in other back-ends, or even in the front end. BUG=angleproject:1635 Change-Id: I18ec19a891a9bdfa7b80dea1b8e308abf206906b Reviewed-on: https://chromium-review.googlesource.com/450919 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov f5bb220f 2017-02-17T23:25:17 Restore Default Platform logging to stderr Was lost in https://chromium-review.googlesource.com/434188 Also, don't reset pre-set Platform to Default, otherwise Chrome's platform gets reset. BUG=angleproject:1660, angleproject:1892 Change-Id: I052c86c513c8d89d2420a4724a8bd0dc7446c7c2 Reviewed-on: https://chromium-review.googlesource.com/444928 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 75066e7a 2017-02-15T17:26:13 Clean up EVENT() logging. These don't need newlines, or a severity prefix. BUG=angleproject:1660 Change-Id: I8a01c55a7e3d8915f48c2a29f43ddc0a37eb64f3 Reviewed-on: https://chromium-review.googlesource.com/443353 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill abf38572 2017-02-14T16:47:59 Remove old C++ ANGLE platform. Now that the new platform is in place, we can remove the old methods. Must be landed after https://codereview.chromium.org/2697463003/ BUG=angleproject:1892 BUG=chromium:678870 Change-Id: Ia29a3b120cf3521fc0409019c2e64e4dbc6f460d Reviewed-on: https://chromium-review.googlesource.com/441274 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho ceb1048f 2017-02-13T12:31:03 Add classification of image type enums Implement classifying image enums in utilities and plumb the image type check to Uniform objects as well. This functionality will be used to add API support for images. BUG=angleproject:1442 Change-Id: Idd2ee5ebacd38290aeeace1177165c740bc42c7e Reviewed-on: https://chromium-review.googlesource.com/441585 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill b1eeba1f 2017-02-13T16:36:40 Use a C API for the ANGLE platform. The main purpose of this change is to fix a fuzzer bug where we would trigger undefined behaviour calling between Chrome and ANGLE. It's not specced how virtual function calls work if the shared objects are not directly linked together, and ANGLE and Chrome are not linked. Replace the old class-style API with a C dispatch table. Follow-up work will make the Platform owned by the Display instead of using global variables, but fixing this is a bit tricky. BUG=angleproject:1892 BUG=chromium:678870 Change-Id: Iad188bc2e50f2b5e4a03ce0de233d686f569c705 Reviewed-on: https://chromium-review.googlesource.com/441273 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@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>