src/libANGLE/validationES_unittest.cpp


Log

Author Commit Date CI Message
Jamie Madill c43be720 2017-07-13T16:22:14 Implement ANGLE_program_cache_control extensions. This will give the browsers the ability to control the cache size, query and populate the contents, and trim cache contents on memory pressure. BUG=angleproject:1897 Change-Id: I6edaa7d307b890223db98792d5b074e4a7fdfaa4 Reviewed-on: https://chromium-review.googlesource.com/563606 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Brandon Jones 6cad5667 2017-06-14T13:25:13 Improve Debugging Strings This change replaces common string literals used for error messages with const string variables mapped in a new header file. Additionally, more validation for WebGL naming scenarios has been added, along with unit tests. BUG=:angleproject:1644 Change-Id: Icff44a456aa78221c6df12b0454a7cc147a7d26e Reviewed-on: https://chromium-review.googlesource.com/535974 Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
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>
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>
Jamie Madill fa416b18 2017-04-06T11:34:17 Disable ValidationESTest.DrawElementsWithMaxIndexGivesError. Temporarily until we have a proper fix. BUG=chromium:708835 Change-Id: I9c1d63d8d1f831f2a4a168149b7ff805bc851def Reviewed-on: https://chromium-review.googlesource.com/469967 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e08a1d36 2017-03-07T17:24:06 Plumb robust resource init extensions. This also cleans up a few minor glitches in the extension texts, and renames the EGL extension for consistency. It incidentally fixes a bug in our EGL init where we were checking the wrong client versions for KHR_create_context. It also implements a new feature for tests which allow them to defer Context creation until the test body. This allows tests to check for EGL extension available before trying to create a context with certain extensions. BUG=angleproject:1635 Change-Id: I9311991332c357e36214082b16f2a4a57bfa8865 Reviewed-on: https://chromium-review.googlesource.com/450920 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill a02315b0 2017-02-23T14:14:47 WebGL Compat: Add DEPTH_STENCIL attachments. This is a special WebGL 1 binding point, that does not correspond to any native functionality. Due to particularities in validation we need to represent this with additional state in the Framebuffer. WebGL 2 fixes this oddity by resolving to the GLES 3 native spec. In order to pass the WebGL framebuffer objects test, we will also need a chromium-side CL to work with the additional state tracking it does in the blink layer, and an additional patch to ANGLE to clear the depth buffer before the first use (robust resource init). BUG=angleproject:1708 Change-Id: I111f8f5a451cce7de6cf281a6bc335b92dd2daf2 Reviewed-on: https://chromium-review.googlesource.com/444095 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiawei-Shao 2597fb64 2016-12-09T16:38:02 ES31: Refactor VertexArray for Vertex Attrib Binding OpenGL ES3.1 feature Vertex Attrib Binding requires vertex arrays should be split into two arrays: 1. an array of vertex buffer binding points, each of which specifies: - a bound buffer object, - a starting offset for vertex attribute data in that buffer object, - a stride used by all attributes using that binding point, - a frequency divisor used by all attributes using that binding point. 2. an array of generic vertex attribute format information records, each of which specifies: - a reference to one of the new buffer binding points above, - a component count and format, and a normalization flag for the attribute data, - the offset of the attribute data relative to the base offset of each vertex found at the associated binding point. Current ANGLE implementation simply uses a struct to represent a vertex attribute object, which does not meet the requirements above. This patch aims to be the the basis of the implementation of all ES3.1 Vertex Attrib Binding APIs by refactoring the struct VertexAttribute and the class VertexArray to fit the new data layout and ensuring all current functionality is retained. BUG=angleproject:1593 TEST=angle_unittests, angle_end2end_tests, gpu_unittests Change-Id: Ieb41f1bf503f815fd0476d2ea045dcb863465254 Reviewed-on: https://chromium-review.googlesource.com/418880 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang feb8c686 2017-02-13T16:07:35 Add extensions to disable client arrays. Chrome doesn't allow any client data in its command buffer. Add an ANGLE extension to request a context that disallows client data. BUG=602737 Change-Id: If9d5144daea3c629a73562396000df59a671aad3 Reviewed-on: https://chromium-review.googlesource.com/441986 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6c1f671b 2017-02-14T19:08:04 Add destroy hooks for several GL objects. These hooks allow the back-end renderer to free object resources without having to store pointers to shared device handles for each and every object. This will allow us to save memory on back-ends that really care about memory overhead. There is a downside in that there is more boilerplate in passing gl::Context handles around everywhere. BUG=angleproject:1684 Change-Id: I89463bba8d23f92920e8956650cb73c7fc6d66b7 Reviewed-on: https://chromium-review.googlesource.com/426401 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang ce02f086 2017-02-06T16:46:21 Add an extension to share textures at the display level. BUG=angleproject:1639 Change-Id: If9140142ebce89f33921c13d9d212c17d1894162 Reviewed-on: https://chromium-review.googlesource.com/437618 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 8897afa1 2017-02-06T17:17:23 Pass Context around to Texture::copyImage. Passing this through the chain will allow us to have access to the platform methods, as well as be useful in the future for Vulkan. BUG=angleproject:1660 Change-Id: I819984fceeb5a2a299aa54e59ef3b428f5f9c91f Reviewed-on: https://chromium-review.googlesource.com/438684 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 3bf8e3a2 2016-12-01T17:28:52 Refactor Framebuffer management into a FramebufferManager class. BUG=angleproject:1639 Change-Id: I03a0950f26557983c8dc816a27cb4038c60e5755 Reviewed-on: https://chromium-review.googlesource.com/415611 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 4ddf5afb 2016-12-01T14:30:44 Refactor ResourceManager into separate managers per resource type. BUG=angleproject:1639 Change-Id: I943f553cfb0e0feb57953770784b48e22fccc875 Reviewed-on: https://chromium-review.googlesource.com/423172 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
He Yunchao acd1898e 2017-01-04T10:46:42 Replace Error(GL_NO_ERROR) with NoError(). In order to make the errors be consistent throughout ANGLE. BUG=angleproject:1686 Change-Id: I0a2d86091d640aedeac94beae345c1fb6971b00d Reviewed-on: https://chromium-review.googlesource.com/424835 Commit-Queue: Yunchao He <yunchao.he@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 192745a7 2016-12-22T15:58:21 Add varying packing validation for WebGL. This CL moves the varying packing from the D3D layer up to Program. This is necessary for WebGL validation, and gives us consistency for the various back-ends. There may be some additional cleanup work on the VaryingPacking class, because it does some work that is D3D- specific. WebGL requires strict varying packing. Instead of allowing success unconditionally, it's an explicit error to succeed to pack a set of varyings that the sample algorithm would fail to pack. Introduce a new packing mode option to the varying packing class to handle this different packing style, while keeping our old more relaxed packing method for ES code. BUG=angleproject:1675 Change-Id: I674ae685ba573cc2ad7d9dfb7441efa8cb2d55fc Reviewed-on: https://chromium-review.googlesource.com/423254 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 01a80eeb 2016-11-07T12:06:18 Refactor all the Bind* GLES 2.0 entry points. This requires storing a reference the the Context's Framebuffer map in the ValidationContext. Likely we'll need to do this as well for the other non-shared object types. BUG=angleproject:747 Change-Id: I73ee8b0be3c3b9e54b7e48e49d6f738cf1d926dd Reviewed-on: https://chromium-review.googlesource.com/407843 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang eb66a6e2 2016-10-31T13:06:12 Replace the GLVersion class with gl::Version. Update code to use gl::Version in as many places as possible to ease ES 3.1 support. BUG=angleproject:1588 Change-Id: I3490b53a81027cf849dac551a9cc66ce04506144 Reviewed-on: https://chromium-review.googlesource.com/404946 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang f41a7151 2016-09-19T15:11:17 Add an extension to disable resource generation on bind. BUG=angleproject:1518 Change-Id: I662f7b07da5c97831496f2617b0adadf9858bdc9 Reviewed-on: https://chromium-review.googlesource.com/386799 Reviewed-by: Antoine Labour <piman@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Martin Radev 1be913cf 2016-07-11T17:59:16 Add support for ES31 context creation The dEQP test for context creation passes. SH_WEBGL3_SPEC has been added, but it should be considered whether we should keep it, remove it or rename it. It was added so that there is a webgl mapping to es 310 shaders. Check Compiler.cpp. The bison file has been modified so that some tokens from es3 can be also used in es31 as well. A separate macro ES3_1_ONLY is added so that some tokens are limited only for es 310 shaders. BUG=angleproject:1442 TEST=angle_unittests Change-Id: I2e5ca227c96046c30dc796ab934f3fda9c533eba Reviewed-on: https://chromium-review.googlesource.com/360300 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dfde6abf 2016-06-09T07:07:18 Context: Remove mutable gl::State getter. This will preserve layering - the API layer doesn't mutate the state directly, it passes the API call through to the Context. Is also removes the possiblity of any shenanigans of the Validation layer changing the GL state. Also, this CL refactors a few validation entry points to take ValidationContext instead of Context. ValidationContext will be the correct way to interact with the gl::Context in the Validation code. Finally, additional refactorings make ContextState a proper class with private data. This allows the ContextState itself to keep a mutable pointer to the gl::State, so ValidationContext can modify it if necessary (and it will be necessary for Framebuffer completeness caching). BUG=angleproject:1388 Change-Id: I86ab3561573caa9535c8d1b8aad4ab3d0e7cd470 Reviewed-on: https://chromium-review.googlesource.com/348954 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7aea7e05 2016-05-10T10:39:45 Add EGLImplFactory. Also rename ImplFactory to GLImplFactory. This will allow us to use the same factory design pattern for EGL objects, and to use State helper classes to share data with Impls. BUG=angleproject:1363 BUG=angleproject:1369 Change-Id: I07a8fe40838d5d4ca32b04910c306edeab4d25a7 Reviewed-on: https://chromium-review.googlesource.com/342051 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 437fa654 2016-05-03T15:13:24 Add a ContextImpl class. This class can contain impl-specific functionality for a Context. This will eventually replace the Renderer class, and we can then start passing around a gl::Context instead of gl::ContextState. In D3D11, the ContextImpl could hold a DeferredContext, which would enable multi-thread rendering. In GL, we can implement non-virtual (native) Contexts. In Vulkan it might store the logical device. BUG=angleproject:1363 Change-Id: I39617e6d1a605d1a9574832e4d322400b09867ec Reviewed-on: https://chromium-review.googlesource.com/340745 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9082b982 2016-04-27T15:21:51 Rename gl::Data to gl::ContextState. Part of the new world order of renaming the Obj::Data classes to ObjState. BUG=angleproject:1363 Change-Id: I15cf002b8b093d687f540b9e86f045874af24a7e Reviewed-on: https://chromium-review.googlesource.com/340740 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 82c47ad0 2016-04-20T18:28:47 Pass ImplFactory to Texture constructor This improves encapsulation inside the Texture class, and removes duplication of createTexture calls. This is a necessary step towards adding a shared "Data" structure to the Texture classes, following a similar pattern as for example the Framebuffer class. This patch also shares the same MockFactory class among different unit tests. BUG=angleproject:596 TEST=angle_unittests Change-Id: Ie8d3a9aa4ec35565d7ecbabb8c40e7b1ba068721 Reviewed-on: https://chromium-review.googlesource.com/340200 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 60ec6ea7 2016-01-22T15:27:19 Implement dirty bits for Framebuffer. The dirty bits set the stage for performance improvements in D3D, but don't actually reduce any of the redundant work just yet. BUG=angleproject:1260 Change-Id: Ib84e6a9b7aa40c37c41790f492361b22faaf4742 Reviewed-on: https://chromium-review.googlesource.com/318730 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 46e6c7a5 2016-01-18T14:42:30 Add stubs for no_error extension. In some cases ANGLE flushes state for FBOs during validation. For testing of the state synching code for FBOs, this makes end-to-end testing impossible. Solve this by partially implementing a hidden no_error extension, hidden to the user by not exposing the extension string, but allowing us to skip validation of some of the FBO methods that require checking for complete FBOs. BUG=angleproject:1280 BUG=angleproject:1260 Change-Id: I708f348ccec6697b974c48cd890ec75a703abe21 Reviewed-on: https://chromium-review.googlesource.com/322210 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 70d0f499 2015-12-10T17:45:46 Implement GL_KHR_debug. BUG=angleproject:520 Change-Id: I9ced3e7ab1515feddf2ec103c26b2610a45b1784 Reviewed-on: https://chromium-review.googlesource.com/319830 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 66988745 2015-12-22T19:39:19 Revert "Implement GL_KHR_debug." This reverts commit 6c521b7a70a53b1c9f7762e53e34b5a8146b0f7b. Change-Id: I6ff981198e31f34d3e405edea6277ee75516d6ee Reviewed-on: https://chromium-review.googlesource.com/319820 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 6c521b7a 2015-12-10T17:45:46 Implement GL_KHR_debug. BUG=angleproject:520 Change-Id: I78d14cc8c94f5cef58604220f0ca847473b25bf8 Reviewed-on: https://chromium-review.googlesource.com/317820 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill cc86d64e 2015-11-24T13:00:07 Make Framebuffer size check ES2-only. This is an ES2-only incompleteness check. We also need to require matching dimensions in D3D11, but make this an implementation specific check. Also make all implementation specific errors 'UNSUPPORTED' since that catches all "non-ES" framebuffer restrictions. Note that we can't be conformant here in D3D11 currently, since the spec only makes an exception for mismatching formats for UNSUPPORTED, not for size checks. However, we don't have an easy solution. BUG=angleproject:1225 Change-Id: Ic80a04bce397fc12643b010c874f432033babc5d Reviewed-on: https://chromium-review.googlesource.com/313990 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill daa8c27f 2015-11-18T14:13:55 Fix a user-after-free in a ValidationES unittest. The State destructor was trying to unref a Program that had already been deleted. Fix this by unbinding resources from State before we exit the test. BUG=554520 Change-Id: I2215b1e5d27a34a649572c8f81e96dfeef7e983e Reviewed-on: https://chromium-review.googlesource.com/312977 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e79b1e14 2015-11-04T16:36:37 D3D11: Restrict use of MAX_UINT element indexes. We need to block the app from using MAX_UINT on D3D11 because we can't disable primitive restart on this platform. Instead generate an INVALID_OPERATION error, which is spec-compliant in ES3 because the result is undefined behaviour. This is also compliant with WebGL which explicitly defines an error here. BUG=angleproject:597 Change-Id: I7ebc5371b63ff860dc6dddf79939e9629ebb2a3c Reviewed-on: https://chromium-review.googlesource.com/309638 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>