src/libANGLE/validationES.h


Log

Author Commit Date CI Message
Charlie Lao d8dc3cc2 2025-08-02T12:02:20 Remove shared context lock from glVertexAttrib{I}Format This CL removes shared context lock from glVertexAttribFormat() and glVertexAttribIFormat() APIs, since they no longer access anything outside VertexArrayPrivate. The main problem I had run into is validation code. Before this CL, ValidateIntegerVertexFormat() needs context's mStateCache for mCachedVertexAttribTypesValidation and mCachedIntegerVertexAttribTypesValidation. Given these two cached value are constant after initialization, in this CL, I have moved them to PrivateStateCache. PrivateStateCache argument is added to ValidateVertexAttribFormat() and ValidateVertexAttribIFormat() to get them access to mCachedIntegerVertexAttribTypesValidation. Bug: b/433331119 Change-Id: Ifc3fbed32b4d3722c335dd2c393bc6519ed0b544 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6822032 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao fa29f604 2025-07-02T13:23:31 Remove sharedContextLock from {Enable|Disable}VertexAttribArray VertexArray objects are per context objects. In theory they do not need to protected by shared context lock. The reason we are taking locks because all these functions end up accessing Buffer object which are shared. In prior CLs we have removed subject observer usage from VertexArray which means VertexArray no longer accessed from other thread. In prior CLs we also split VertexArray into two classes: VertexArrayPrivate which has no buffer, and VertexArray which is subclass from VertexArrayPrivate and owns buffer. In this CL, glEnableVertexAttribArray and glDisableVertexAttribArray calls no longer take shared context lock. ContextPrivateEnableVertexAttribArray and ContextPrivateDisableVertexAttribArray are called from these two APIs and they only have access to StatePrivate. State Private holds a VertexArrayPrivate pointer, which means they do not have anyway to access buffer objects. The main challenge I run into here is mCachedActiveClientAttribsMask, mCachedActiveBufferedAttribsMask, mCachedActiveDefaultAttribsMask, mCachedHasAnyEnabledClientAttrib, mCachedNonInstancedVertexElementLimit, mCachedInstancedVertexElementLimit. These StateCache variable needs to be updated when these two APIs are called, and calculating these variable needs access to buffer object. The solution here is adding a bool mIsCachedActiveAttribMasksValid in the PrivateStateCache so that instead of immediately update these mCached* variable, we just set mIsCachedActiveAttribMasksValid to false. Then whenever any of these mCached* variable is needed, we will check mIsCachedActiveAttribMasksValid and calculate these cached variables. It adds one if check when accessing these caches, but the other benefit is that we may have avoided duplicated calculation when multiple states changed. Bug: b/433331119 Change-Id: I3227c72bc40501712db93fb3d540b835f07150b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4514436 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Alexey Knyazev 5fd79e6a 2025-05-15T00:00:00 Remove unused parameter from ValidateGetVertexAttribBase Bug: angleproject:409484297 Change-Id: I98fdfe8dbaeb6bc08a0c0a7a4a032850fcbdd37f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6558251 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Xinyu Fang c601f0e7 2025-04-08T17:56:22 Add extra validation of null pointers for certain APIs Bug: angleproject:409110245 Change-Id: I25dfdbdc52cdb0d7d2a91d773a0f3600e370f139 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6440146 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 50707ca6 2025-04-18T00:00:00 Remove duplicate validation declarations Removed redundant function declarations and aligned function definitions with the autogenerated declarations. Bug: angleproject:409484297 Change-Id: Ieb49399ff28e64c4e6a84180a3190895f3c08e20 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6491475 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen 78048112 2025-01-15T15:13:14 Fix IndexRange::vertexIndexCount calculation Use only one loop. Avoid redundant primitive restart index parameter. Avoid calling GetPrimitiveRestartIndexFromType() because the algorithm relies on the value being numeric_limits<T>::max(). Fixes a bug where primitive restart case would process the value after first primitive restart twice, once in both for loops. This would result in incorrect vertexIndexCount. Fix by removing IndexRange::vertexIndexCount, and instead using IndexRange::mCount == 0 to signify empty range. Bug: angleproject:401284933 Change-Id: Ifaeb9949f2e852fb7c5ef80bc47f72bfabba21a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6333541 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Roman Lavrov cbfa8e38 2025-03-31T09:51:33 Add "likely" hints to common validation paths This makes the hot path assembly more local. I can't tell if there is an observable effect of just doing this on the regular build performance, but this generally makes sense and reduces the assembly difference with PGO builds. Bug: b/383305597 Change-Id: Icb191e8e927217d9db4cb505d5cd6f76536403e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6416263 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Alexey Knyazev 1b34d2a1 2025-03-28T00:00:00 Ensure ValidateUniform* consistency Uniform calls are valid when location is -1 or ignored. Bug: angleproject:406922380 Change-Id: I7f829f7f8a67ba6bac39ff8ee06c7f26c1421417 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6408952 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kimmo Kinnunen c2679dbc 2025-03-10T12:15:08 Key vertex array index range cache on restart Key vertex array index range cache on primitive restart enablement. Add the test to WebGLCompatibilityTest as otherwise the VertexArray::getIndexRange() is not testable. Currently WebGL compatibility contexts allow changing primitive restart. Bug: angleproject:401284933 Change-Id: I48a53770d7dcb2276b89fd743f4834c53c8d8d1e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6333538 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Xinyu Fang e914b53d 2025-02-18T17:13:08 Add validation of null pointers for certain APIs Bug: angleproject:397315932 Change-Id: I3b253a7ca0bbdf4fd55cf67943971426d825cd24 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6275697 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Roman Lavrov f45b9951 2025-01-16T10:05:06 Inline ValidateUniformCommonBase Same way as driver_overhead_2 based PGO does it. It makes sense as the function is small and only has a few callers. This happens to reduce .so size by ~10KB due to ValidateProgramUniform* (ES31) changes: clang no longer inlines ValidateProgramUniformBase into those and it becomes a function call - but a call in the same translation unit instead of a call into ValidateUniformCommonBase in another unit. Seems like we get the same number of calls but better locality. Perf imact difficult to estimate due to effects of section layout changes but I do see an improvement when comparing PGO builds, disabling this optimization for an affected function then re-enabling it with this CL. Bug: b/383305597 Change-Id: Ib76d33d01b165049335e61c007ee79bec53219c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6175711 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Neil Zhang 0501d32f 2024-12-23T18:02:54 Draw call with un-aligned index buffer should be checked Bug: angleproject:385264236 Change-Id: I1ff7e93bf4b9ea9020e82f3558e4157b74cb7078 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6151227 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 0bb109aa 2024-11-28T00:00:00 Fix validation for 2D multisample array textures * Fixes: * TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY query must be rejected if the functionality is not enabled. * GetInternalFormativ must accept TEXTURE_2D_MULTISAMPLE_ARRAY on unextended OpenGL ES 3.2 contexts. * Added validation to the OpenGL ES 3.2 TexStorage3DMultisample entry point. * Cleanups: * Removed OES suffix from the enum conversion. * Incorrect extension name in the error message. * Do not create a 2D multisample array zero texture object if the backend does not support the functionality. * Replaced redundant FramebufferTexture validation with an assertion. * Do not allocate texture binding vectors for 2D multisample array textures if the backend does not support the functionality. * Aligned the 2D multisample array texture target assert in RecordBindTextureTypeError with the actual error condition. Fixed: angleproject:381270278 Change-Id: Idbbc86e2efe1bbc25d9570d515b67c1a32255d99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6063068 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev abf7b612 2024-03-28T00:00:00 Optimize WebGL clear type validation Use cached component type masks instead of iterating over all attachments every time. Fixed: angleproject:8618 Change-Id: I45b83639120c0b4f50027d1d85fe9158f5cf187d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5407657 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Shahbaz Youssefi 18a68f6d 2023-12-07T16:23:10 Fix vertex attribute limit check Bug: angleproject:8448 Change-Id: Ie5d2b71f0be86b31ec74a1d55501b60a25245668 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5101508 Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 817f4b81 2023-07-10T00:00:00 Restrict color writemasks for RGB9_E5 color buffers Per-channel write operations to shared exponent color buffers are loosely defined and may cause driver validation errors. Restricted the set of allowed color writemasks for RGB9_E5 color buffers so that RGB channels must be either all enabled or all disabled. Added a Metal-specific adjustment to ignore alpha writemask for RGB9_E5 color buffers. Removed an unused function from RenderPipelineColorAttachmentDesc. Bug: angleproject:8043 Change-Id: I902c3b70ddc6d8e65069d98a4a02a82122f413a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4685566 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 74cf6a3a 2023-07-12T14:44:17 Ensure lockless entry point validations only access private data Bug: angleproject:8224 Change-Id: I19e867923b088879f9f37d0a3b4ff8b681470be0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678352 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c9a42949 2023-07-12T15:07:17 Make validation make straight calls to ErrorSet ... and avoid going through the context (just to get a const cast). This change is also in preparation for an follow up where some entry points directly use ErrorSet and don't access context at all. Bug: angleproject:8224 Change-Id: Idef0a88d9407870e7a84b4fe6967fbff175c269b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678350 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 491c2a54 2023-07-11T15:20:09 Split the context-private part of the state cache In preparation for passing it directly to entry point implementations, ensuring no access to the share-group-accessible part. Bug: angleproject:8224 Change-Id: I705e6a8fb5204bab71caffff4dcb56d16c3d6e10 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678782 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 8bc7fffb 2023-06-21T10:54:27 Include framebuffer completeness reason in draw errors Framebuffers have a much more detailed "reason" string for framebuffer completeness errors. Make sure that reason is printed when a draw call fails due to incomplete framebuffer. Rework how draw validation errors are stored to keep the extra GL error enum. Bug: chromium:1455725 Change-Id: I5984452c5aab4f8ccb73d43bd63bca1aae53e847 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632578 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 8403e4c5 2022-10-10T20:59:29 EGL: Resource IDs for Surface, Context and EGL Image. This will make these classes play nicely with resource maps. As these objects are used in a lot of places, and simplified C can't handle unordered_map, it's necessary to index the maps by simple packed IDs in capture/replay code. This indirection will also have increased safety as we validate EGL resource ID handle values before accessing the memory directly. Also hides some of the other EGL capture methods behind helper methods to simplify the C code and hide assignments and other complex maps. Bug: angleproject:7758 Change-Id: Ibc7bb56430d3068bd38877c9dfb011979d4ea234 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957164 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 97926f80 2022-09-15T00:10:49 GL: Implement GL_ANGLE_logic_op Enabled only on Desktop GL where logic op is available. Bug: angleproject:7654 Change-Id: I3c17ffb5b21abf31aec247319a625526f1bec37d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3898316 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Lubosz Sarnecki 02eb5f49 2022-08-19T12:41:11 validation: Annotate kEnumNotSupported errors with values. Use validationErrorF to annotate all unsupported enum errors with the corresponding value of the enum in hex. This makes the errors more meaningful and reduces the amount of debugging required to find out the invalid enum used. Add kEnumInvalid error string in cases an InvalidEnum is provided and can't be resolved to the given GL enum. Before: glEnable: GL error: HIGH: Enum is not currently supported. After: glEnable: GL error: HIGH: Enum 0x809D is currently not supported. Bug: angleproject:7595 Bug: angleproject:7596 Change-Id: Iff060a1c3a2f482f4df5b5b7ea036b93025df7d9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3849475 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev df879d49 2022-07-22T00:00:00 Return INVALID_VALUE for online BC compression As per discussion with OpenGL ES WG, implementations are allowed to generate INVALID_VALUE when online BC compression is not supported. Bug: angleproject:6441 Change-Id: I0e282c970f1e03afbc590dc9a46b8ce38d869691 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3780923 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Lingfeng Yang 7d6f3d94 2022-07-14T13:25:04 glValidateProgramPipelines: Skip draw state error check Certain apps will call this API while having a surfaceless context, making it improperly fail. dEQP tests that previously relied on the full draw states check were actually relying on the part where the draw state check included a check that the pipeline object had programs/shaders. Relax the validation of the pipeline to only include that validation, and not also the framebuffer state / VBO state / etc. Bug: b/223456677 Change-Id: I9211761934668aae8a20f07ac4f36b7f6c1281da Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3764434 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Brandon Schade 3a799ba5 2022-05-16T17:26:38 Fix ValidateES3TexImageParametersBase for glTexImage*D From the OpenGL ES 3.2 spec: GL_INVALID_VALUE error is generated if internalformat is not one of the valid formats in tables 8.2 or 8.3. glTexImage*D should not accept compressed format. Add check in validation to account for this. Bug: angleproject:6441 Tests: KHR-GLES31.core.compressed_format.api.invalid_teximage_with_compressed_format Change-Id: I7152aefa433f42dcc40cf693538639df26c31341 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3648587 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang c3f15962 2022-04-14T10:11:56 Fix OOB problem in validationES.{h,cpp} maxVertexAttributes may less than the gl::MAX_VERTEX_ATTRIBS for some GLES2 devices, so using gl::MAX_VERTEX_ATTRIBS may cause OOB problem. Bug: chromium:1258869 Change-Id: I09609db35143fbf17b4228c7fe5f38a987e4f1d9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584637 Auto-Submit: Peng Huang <penghuang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 078da78f 2022-03-17T13:06:58 Vulkan: Support GL_EXT_EGL_image_storage extension This extension provides a mechanism for creating texture objects that are both EGLImage targets and immutable and removes the possibility of implicit orphaning. EGL images created from external sources now support types other than 2D. Tests covering the new feature were added to ImageTest.cpp. Bug: angleproject:6346 Change-Id: Id3e328f352deb1af47062be232384229a8b1c341 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3530489 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Jamie Madill d9002eef 2022-03-01T16:14:47 Protect against deleting a current XFB buffer. Bug: chromium:1295411 Change-Id: I097f272c38e444e0af71aa55c0dc508a07aa0bd3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3498262 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya e38dab0a 2022-01-10T10:58:40 Add missing implementation for glGetnUniformuiv() GL_KHR_robustness became core in GLES 3.2 and added glGetnUniformuiv() function in gles_3_2 entry points but this function was missing implementation in Context.cpp. Also fixes ES32 validation for glGetnUniform*v Bug: angleproject:6593 Tests: KHR-NoContext.es32.robustness.getnuniform Change-Id: Ic26190e59d448d93ae9e2e0d2a7faff14c3776f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373436 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Maksim Sisov beda2459 2021-12-09T14:24:08 Add support for GL_MESA_framebuffer_flip_y 2/* This is a second CL that adds actual implementation for GL_MESA_framebuffer_flip_y extension. Also, some tests are added to verify the functionality. Please note that bots do not support this extension yet, and the tests were verified by running them locally. Bug: chromium:1231934 Change-Id: Iea483aa13a298df6b5cf0b7b5ffb795a4666e3bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3329603 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Maksim Sisov <msisov@igalia.com>
Gregg Tavares cf9ab647 2021-12-10T15:42:36 Add early out validation in drawArraysCommon Bug: angleproject:6791 Change-Id: I60de6806dae9c917c6db24a18f586e3b0aa2154e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3331414 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
YuxinHu 2aa5286d 2021-10-12T17:05:48 Add Entry Point name to validation errors Add gl/gles entry point names to validation error messages some special cases: 1. Debug::insertPerfWarning() is invoked from multiple places, such as TextureVK, ContextVK, adding an extra entryPoint function parameter in these files will need extra investigations. I am passing the entryPoint name GLInvalid as a temp workaround. 2.ErrorSet::hangleError() is invoked from multiple Context*.cpp files, adding an extra entryPoint function parameter in these files will need extra investigations. I am passing the entryPoint name GLInvalid as a temp workaround. 3. Debug::insertMessage(), Debug::popGroup(), Debug::pushGroup() can be invoked from more than one GL entry points, e.g. Debug::pushGroup() can be invoked from either GL_APIENTRY GL_PushDebugGroup() or GL_APIENTRY GL_PushDebugGroupKHR() through context->pushDebugGroup() call. Right now the same entry point name glPushDebugGroup will be printed out in the error message for both cases. However, we should be able to tell the actual entry point by checking which version: KHR version or core version the application uses, and this helps avoid the confusion. For now we will let the same entry point name getting printed for both cases. Bug: angleproject:6523 Change-Id: I64a5463d9168d8444d376d1f428c3b3d894f2ea9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3215063 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Jamie Madill 49ac15a5 2021-09-20T11:29:01 Optimize VAO bindings. This CL makes the XFB binding tracking WebGL-only. That will speed up VAO binding changes in non-WebGL considerably. Also has a few inline micro-optimizations that may not have a large effect. Bug: angleproject:6371 Change-Id: Ib0a26a3b956dcd6ff78626e5cd6514b46270d882 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3170116 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1ca1589f 2021-09-13T10:56:58 Give GLES extension bools a vendor suffix. This is in preparation for auto-generation which will give all of these bools suffixes. Bug: angleproject:6379 Change-Id: I7e3f6c9b644c41a2165e6bf7b62d661fd352a250 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3158503 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang bccb0d56 2021-05-11T13:53:05 Add messages for framebuffer completeness errors. This also creates a common code path for all framebuffer completeness errors (FramebufferStatus::Incomplete) which helps for adding a debug breakpoint. Bug: angleproject:5949 Change-Id: Ib102dbf86e020777e56c6dc6b78dda8ebdba2127 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2888110 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 351e6e8c 2021-01-26T17:08:59 Add 'UniformBlockIndex' struct Add the new structure 'UniformBlockIndex'. This is in preparation for capturing glUniformBlockBinding() calls, which requires the (new) corresponding ParamType::TUniformBlockIndex. Bug: angleproject:5564 Change-Id: I88613dd96d058659dd253e8088fab49670c32316 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2651287 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill b912eec5 2020-11-27T11:08:41 Vulkan: Support GL_EXT_tessellation_shader. Shader translator changes done in http://crrev.com/c/2633936 Adds a new DIRTY_BIT_PATCH_VERTICES state to Context. Supportes state query and transform feedback. 4 test suppressions remain as follow-up fixes. Adds a new varying packing mode for a simple Vulkan rule set. Based on work by Mohan Maiya (m.maiya@samsung.com). Test: dEQP-GLES31.functional.tessellation.* Bug: angleproject:3572 Change-Id: I4cad2cca30adb754fd12c83027673906541f566a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2568234 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya ccd0b7e1 2020-11-30T08:37:04 Add support for OES_framebuffer_object extension Expose OES_framebuffer_object extension for GLES1 contexts. Bug: angleproject:5401 Test: FramebufferObjectTest* Change-Id: I63b504f580cdab4655b4bfbd3438bcd807b422ea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2561795 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill cfe14e28 2020-11-19T18:11:42 EGL: Remove egl::Error from validation code. Instead of using an egl::Error return value, errors are recorded on the egl::Thread immediately at the call site. This makes the code work the same way as in the GL entry points. Updates the EGL "try" macros to include a special handler for the EGL validation entry points. Uses a special ValidationContext helper class to preserve the existing info. Bug: angleproject:5378 Change-Id: I897f221a41fe406676950600e4ac559081b9f541 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2551790 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Brandon Schade 1e494cae 2020-10-07T19:26:01 Vulkan: Add support for EXT_copy_image Add support for GL_EXT_copy_image which allows image data transfer between image objects. This is implemented by using the vkCmdCopyImage API call. Bug: angleproject:3593 Test: dEQP-GLES31.functional.copy_image.* Change-Id: I30a34a8711b5d2e5834064d7453e03d6ec0df478 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2393955 Commit-Queue: Brandon Schade <b.schade@samsung.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill f6f20601 2020-09-13T23:29:55 Vulkan: Optimize Attribute Change Perf (4/5) This patch series optimizes programs that use the pattern: for (;;) { glVertexAttribPointer(...) glDraw(...) } Change 4: Inline ValidateProgramDrawStates. A hotspot in most draw calls that change state. In total the patch series reduces test iteration time by 25%. This change reduces the listed "null" benchmark time from 295 -> 286 ns. Test: DrawCallPerfBenchmark.Run/vulkan_null_attrib_change Bug: angleproject:5045 Bug: b/168493024 Change-Id: I80959c9d06030709d7f4eba696e43614c33d5a8f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2409176 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f776eb9c 2020-08-01T23:45:24 Vulkan: EXT_multisampled_render_to_texture2 support The previous change that implemented EXT_multisampled_render_to_texture already provisioned this extension in the Vulkan backend. This change implements the front-end for this extension and enables it in the Vulkan backend. Bug: angleproject:4836 Change-Id: I7080260972e61727c5716051c236f635668cb67b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2330510 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill e09f7a14 2020-04-30T17:43:12 Validation: Fix some function types. These were slightly mismatching the header types. They seemed to link fine despite producing some warnings in a tool. Bug: angleproject:4598 Change-Id: I19cfe4d87eca409c82a7c8cf25fff6f8a4c83ca9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2175057 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 57d95828 2020-04-30T17:35:50 Revert "Add type for attribute locations." This reverts commit 9349c14344b2d1fd6bc357063b602bc2626c140f and commit d43b057435e6c9e3194dd20627681ffca0c0808e. It's no longer needed after we bind attribute locations before link. Original CL message: This will allow the capture/replay tool to easily intercept and label attribute locations for remapping. There's some inconsistency in implementation in the GL desktop front- end. This is a quick fix and the full implementation is left for when we implement the full desktop GL API set. Bug: angleproject:4598 Change-Id: Ic510159d4d1982eff41560503cabf983a1be0381 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2174076 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9349c143 2020-04-29T16:36:17 Add type for attribute locations. This will allow the capture/replay tool to easily intercept and label attribute locations for remapping. There's some inconsistency in implementation in the GL desktop front- end. This is a quick fix and the full implementation is left for when we implement the full desktop GL API set. Bug: angleproject:4598 Change-Id: Ibf11bcb8669d27265ea376494a2e3124825cf3be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2171933 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Alexis Hetu 95741743 2020-04-27T18:09:42 Validation fix for draw with primcount <= 0 A buffer size validation check was returning an invalid operation error based on buffer size, even when primcount is <= 0 (so the buffer isn't used). Fixes the following WebGL 1.0.4 test with SwANGLE: conformance/extensions/angle-instanced-arrays-out-of-bounds.html Bug: b/154628007 Change-Id: Ibfe4eb57f17cd07100fb8dfbe8069e9ec7515160 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2168546 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Tim Van Patten 405f8e7b 2020-02-24T17:38:10 Vulkan: Support Program Pipeline Objects Add support for PPOs to the Vulkan back end. Bug: angleproject:3570 Change-Id: I5403456929847c185467b008d810f31ecfcb60cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2072652 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill a18f4145 2020-02-19T22:42:12 Trace/Replay: Add uniform location type. This is a large refactor that replaces instances of "GLint location" for uniform locations with "UniformLocation location". This boxed type is similar to the ResourceID types that we use to capture resource IDs more easily. Eventually this will give us a more portable replay. Bug: angleproject:4411 Change-Id: I848e861c3956d95b6b953f57f8b6a2c4a676766f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2066117 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill bd4e756a 2020-02-17T09:49:45 Const-ify the validation layer. Enforces that the validation layers should be working pretty much read- only with the exeption of updating caches. Requires a few tricks: - updates EP code generation to add 'const' to pointer parameters - enables a kludge const_cast to enable the robust query extension - makes some members of Framebuffer mutable to work around syncState - makes 'is' queries and other methods in Context/State const Will allow us to more safely expose the no_error extension. Bug: angleproject:1280 Change-Id: Id9756757854c9e68fc096ecec8d93759fbe6b3a4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2060689 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev 33b1e31e 2020-02-08T17:48:56 Fix compressed formats validation with TEXTURE_3D Bug: angleproject:4385 Change-Id: Ibc1b482ec851d8076aacad84ab67fe20a745c122 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2045512 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Shahbaz Youssefi 232d009d 2019-11-27T10:12:23 Fix string literal comparison in validation String literals shouldn't be compared by pointer, especially if the literal is declared in a header (so the two pointers can come from different translation units, because the string literal might have a different copy in each). Use strcmp instead. Bug: angleproject:4175 Change-Id: I6002ccb185f48928b67ce8a7b3508e427761a8c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1940568 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinyi He 4c7db77e 2019-10-31T15:42:31 Vulkan: Set limitation on maxComputeWorkGroupCount According to Table 20.45 and Chapter 17 in the ES 3.1 spec, MAX_COMPUTE_WORK_GROUP_COUNT is get as a GLint by using GetIntegeri_v. However, it is an unsigned integer in the Vulkan. It needs to set limitation on maxComputeWorkGroupCount[] during translating. 1. Change the data type to GLint stored in Caps. 2. Ensure that the limitation is set during initialization. 3. Add workaround for angleproject:4120 Bug: angleproject:4066 Change-Id: I1659ba1d560e30b9599cace0feeab8a18890c3ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1890586 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dfc20daf 2019-10-28T13:51:42 Plumb more logic for ANGLE_get_image. Also implements and tests validation / negative API. Bug: angleproject:3944 Change-Id: I3385a4255f4fab6a12eee2abfa5ffcce2107359a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879961 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Mingyu Hu 2d0e5b55 2019-08-27T13:49:07 GL_EXT_multisampled_render_to_texture extension. Part 2. For textures that use this extension, a multisampled texture is implicitly created for the texture. Upon write or read, the multisampled texture is either return to be drawn to or resolved and returned as a single sampled texture. This is the functionality change with end2end tests. Bug: angleproject:980428 Change-Id: I5776875a132fed7a3f4f00fb02f9e8e250684630 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1773717 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya fea65766 2019-09-19T09:30:38 Vulkan: Add support for OES_vertex_type_10_10_10_2 - Add support to CPU/GPU convert vertex formats - Add test cases for type conversion in angle_end2end_tests - Fix a bug in shader script by adding a ceil when calculating bytes Bug: angleproject:3192 Test: angle_end2end_tests --gtest_filter=VertexAttributeTest*Packed1010102* Change-Id: I57bab9fc1c1041cd734746d0e52a33717b635ec0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1788495 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Jiacheng Lu feb8507f 2019-09-03T13:22:04 Use VertexArrayID in place of GLuint handle Bug: angleproject:3804 Change-Id: I0454533eff13218a6aa1e1672ffcd0e76aedb399 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769716 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiacheng Lu 120b61d3 2019-08-21T12:51:58 Use ShaderProgramID in place of GLuint handles Bug: angleproject:3804 Change-Id: I5dc640004c2cc054c53261e8e939b6a9f5fc23bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762363 Commit-Queue: Jiacheng Lu <lujc@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jiacheng Lu 814a0a1b 2019-08-22T11:50:43 Use QueryID in place of GLuint handle Bug: angleproject:3804 Change-Id: I921bbe7f67c025ab2b624fe14530c04ac17346f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1765889 Reviewed-by: Jiacheng Lu <lujc@google.com> Commit-Queue: Jiacheng Lu <lujc@google.com>
Jiacheng Lu ee79e2ff 2019-08-20T11:28:36 Use SamplerID in place of GLuint handles Update all Sampler handles to type SamplerID, preparing for midframe capture of sampler. Bug: angleproject:3804 Change-Id: I9337919f97d61e28718987612d642c569b90246a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1761780 Commit-Queue: Jiacheng Lu <lujc@google.com> Reviewed-by: Jamie Madill <jmadill@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>
Jamie Madill 2ab08edc 2019-08-12T16:20:21 Use TextureID in place of GLuint handles. Bug: angleproject:3611 Change-Id: Ie6156e8732b3ca4dc6c4439c059a5481a4dfd250 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1738753 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7c7dec01 2019-08-06T17:44:11 Use RenderbufferID in place of GLuint handles. This will allow frame capture/replay to more easily emulate object handle manipulation. It also provides a bit of type safety. Also generalizes ResourceMap to handle non-GLuint IDs. Bug: angleproject:3611 Change-Id: I174fd260f326e0dbe2aca3f818215c91d82cf48c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1706559 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang d9c17107 2019-07-10T14:56:26 Add support for GL_OES_texture_compression_astc This extension adds 3D compressed texture formats, something ANGLE has not seen before. This requires tracking a compressed block depth for validation and image size computations. Update the ldr and hdr extension checks to be in line with the spec. HDR requires LDR and is not detectable by texture formats alone. Expose all of the ASTC extensions on the GL backend. BUG=angleproject:3675 Change-Id: Id04c7c8ef8541e9556579536cdba899b64303caf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1695923 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 4c0a2361 2019-06-25T10:56:29 Update ValidateSamplerParameterBase to use const parameters. ValidateSamplerParameterBase is called with both const and non-const parameter pointers which caused our explicit template instantiations to not cover all cases resulting in link errors. Force the parameters to always be const so that our instantiations cover everything. BUG=angleproject:3555 Change-Id: Ibf92572ba80a689c75dcdc70e5153d9941da76f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1676305 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 857880e5 2019-05-27T13:39:15 GL: Add extensions to enable hardware video decode on Android. The Android SurfaceTexture API has to be initialized with a texture id which Chrome has to query from an ANGLE external texture. It also rebinds and sets the texture dimensions on calls to SurfaceTexture.updateTexImage so ANGLE must be notified about these changes so that state tracking and validation continue to function. BUG=967410 Change-Id: I92e9077f75835b088da3a8caffb3ff40e9ad0361 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1630293 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2664da8b 2019-04-08T16:26:52 Correct texImage uses of texture type -> target. Similarly to how the subImage calls were corrected. glTexImage and the family of related functions apply to a single texture target. This means we need a different TexImage call for each cube face. This is distinct from TexStorage calls which take a Cube map directly. Note this is mostly a refactoring change. But it does increase code consistency and should allow for more efficient code reuse. Bug: angleproject:3356 Change-Id: I252f8983cdda3a8f0223c44cbbe8d8e2dd319a88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1558673 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jonah Ryan-Davis 2b0553ce 2019-02-08T10:07:21 Implement EXT_instanced_arrays Bug: angleproject:3015 Change-Id: Ib01cc5e0df6db27981cb843a6bd386de5d10c2db Reviewed-on: https://chromium-review.googlesource.com/c/1452740 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c09ae15c 2019-02-01T14:16:32 Enable -Wextra-semi and -Wextra-semi-stmt. This will prevent users from accidentally making semicolon errors in the future. Bug: chromium:926235 Change-Id: I79a6fa376fb1ad8f0fcf1b65b1f572a035d1f4e9 Reviewed-on: https://chromium-review.googlesource.com/c/1446493 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill d51fbe34 2019-01-25T15:03:39 Fold buffer access validation into extensions. We only need to perform vertex array buffer validation if the WebGL compatiblity extension is enabled and robust access is not available. Although sometimes the range checks are useful for determining undefined behaviour they are not required by the OpenGL spec. They also slow down state updates significantly. This migrates the OOR tests into specific WebGL tests. It also requires a change to a Chromium test on the passthrough decoder. Improves perf by about 10% in the Vulkan VBO state change test. Also fixes some robust resource access cases for D3D11. Bug: angleproject:3000 Change-Id: Ice37f38f01c2f27bf32ed55657a30e69d8508335 Reviewed-on: https://chromium-review.googlesource.com/c/1390362 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c8c7d400 2019-01-16T13:27:15 Use a table for vertex attrib type validation. No clearly sampled effect on performance but should require fewer instructions. May lead to future improvements. Bug: angleproject:3014 Change-Id: I64e155926ae2c553b059265780e72e91f91f097c Reviewed-on: https://chromium-review.googlesource.com/c/1393906 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill dd34b3b9 2019-01-16T09:59:54 Pack VertexAttribType enum. This improves performance slightly in vertex array format checks. Instead of needing to switch on GLenum values we can use packed arrays and tables to determine the values we need. Does not significantly affect performance but will enable future work. Bug: angleproject:3074 Change-Id: I6f4821a463e9b41fe3f8c8967eb3ed4c1d6b84be Reviewed-on: https://chromium-review.googlesource.com/c/1393903 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9fa54eab 2019-01-02T18:38:33 Optimize and inline more validation. Previously on each draw call we were checking both the instanced and non-instanced attributes for overflow. On on-instanced draw calls we don't need to do any special checks for instanced attributes. Also we can inline more into the headers. This improves draw call performance slightly. Bug: angleproject:2966 Change-Id: Idf5861d2d9daf9fffd5c84f6a1ea5b23ac8ab713 Reviewed-on: https://chromium-review.googlesource.com/c/1390357 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Markus Tavenrath <matavenrath@nvidia.com>
Jamie Madill 1e853266 2018-12-21T09:07:38 Cache common DrawElements states. Similar to how we cache the base common draw states. This will improve DrawElements performance. Several state checks are optimized into a single 'if' check of a cached value. Also includes a regression test for mapping the element array buffer. Bug: angleproject:2966 Change-Id: Ia6e524a58ad6b7df2e455d67733e15d324b1b893 Reviewed-on: https://chromium-review.googlesource.com/c/1357150 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f5c88e7e 2018-12-08T09:56:38 Refactor and inline DrawElements validation. This moves ValidateDrawBase into a common inline function. It also moves some checks in ValidateDrawElementsCommon into ValidateDrawElementsBase. "Base" is called from DrawElementsIndirect while "Common" is only called from non-indirect entry points. But this improves conformance because the missing checks in "Base" apply to DrawIndirect as well. In a follow-up patch many checks in "Base" will be cached into a single value. Much like what we did for ValidateDrawBase. Also inlines ValidateDrawElements which just calls through to "Common". Bug: angleproject:2966 Change-Id: Ibe0c5db25f403dd52a50dc73373ebb50cedad003 Reviewed-on: https://chromium-review.googlesource.com/c/1357147 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 8dc27f99 2018-11-29T11:45:44 Use packed enum for DrawElementsType. The packing and unpacking take a few extra instructions. But it completely obviates the need for any switches in the validation code. Speed is slightly faster or the similar depending on the back-end. Also add gl_angle_ext.xml to GL entry point generator inputs. This was missing and would cause the code generation to miss certain changes. Bug: angleproject:2985 Change-Id: I1ea41a71db71135000166ead8305ec42d22ff7b3 Reviewed-on: https://chromium-review.googlesource.com/c/1351729 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yizhou Jiang 7310da33 2018-11-05T14:40:01 Implement GetMultismaplefvANGLE and SampleMaskiANGLE of texture multisample extension This patch adds GetMultismaplefvANGLE and SampleMaskiANGLE api. TEST=TextureMultisampleTest.CheckSamplePositions* TEST=NegativeTextureMultisampleTest.Negtive* BUG=angleproject:2275 Change-Id: Ib1e8b856059229bbe88328a28cf2a892f4673214 Reviewed-on: https://chromium-review.googlesource.com/c/1319252 Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4f6592fa 2018-11-27T16:37:45 Remove gl::Error. Removes several TODOs. Only egl::Error remains. Also slightly decreases binary size. Bug: angleproject:2491 Change-Id: I3a9d1c22eb0884ca9e37362463fddd0083faf826 Reviewed-on: https://chromium-review.googlesource.com/c/1337462 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill e0472f3d 2018-11-27T16:32:45 Slight refactor to ErrorStrings.h. Allows for better readability. Also sort the error strings by ID. Bug: angleproject:2957 Change-Id: Ib3900a4c90507ac84496fd5ff916417eb768667b Reviewed-on: https://chromium-review.googlesource.com/c/1337461 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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>
Jamie Madill 610640fa 2018-11-21T17:28:41 Don't use gl::Error in validation. Instead pass error code and error message directly to the Context. As a side effect every validation error has an associated message now. Reduces binary size by almost 100k. Bug: angleproject:2957 Change-Id: I045e8ab57f8f9d787654a32f6f037011fe3a9f24 Reviewed-on: https://chromium-review.googlesource.com/c/1335890 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 778bf09d 2018-11-14T09:54:36 Auto-generate validation headers. This will make them easier to maintain. Add to add new features. Bug: angleproject:2964 Change-Id: I8c1f92e0d0ca15fc4f555f6c537fa9311320ef7d Reviewed-on: https://chromium-review.googlesource.com/c/1334429 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Austin Eng 1bf18ce9 2018-10-19T15:34:02 Implement GL_ANGLE_multi_draw This patch adds entrypoints glMultiDrawArraysANGLE, glMultiDrawElementsANGLE, glMultiDrawArraysInstancedANGLE, annd glMultiDrawElementsInstancedANGLE Bug: chromium:890539 Change-Id: Ic9c374c53892460f44ca6e73a253b78473ac2dff Reviewed-on: https://chromium-review.googlesource.com/c/1282268 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
Yizhou Jiang c0b6c639 2018-09-06T15:02:04 Implement GetTexLevelParameter api of texture multisample extension This patch adds GetTexLevelParameterivANGLE and GetTexLevelParameterfvANGLE. TEST=TextureMultisampleTest.GetTexLevelParameter* TEST=NegativeTextureMultisampleTest.Negtive* BUG=angleproject:2275 Change-Id: Id702ba31df36ab65f46b697d480b5bf01b87e360 Reviewed-on: https://chromium-review.googlesource.com/c/1295830 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
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>
Yizhou Jiang 7818a85c 2018-09-06T15:02:04 Implement GL_ANGLE_texture_multisample API part Support GL_ANGLE_texture_multisample extension. This patch adds enums of multisampled texture and texStorage2DMultisampleANGLE API. TEST=angle_end2end_tests.exe --gtest_filter=TextureMultisampleTest* TEST=angle_end2end_tests.exe --gtest_filter=NegativeTextureMultisampleTest.Negtive* BUG=angleproject:2275 Change-Id: I2cab997edc33aa2d0be6082381545335423f64e0 Reviewed-on: https://chromium-review.googlesource.com/c/804613 Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 956ab4d9 2018-10-10T16:13:03 Optimize several functions for the Program perf test. This gives the same or slightly better performance in the ProgramDraw perf test. Also only set the Program object as dirty when there are dirty bits set in the Program itself. Bug: angleproject:2877 Change-Id: I07b428b40d3e3c24e0a42c970524756b6dc3a30e Reviewed-on: https://chromium-review.googlesource.com/c/1271475 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d84b6737 2018-09-06T15:54:35 Cache ValidateDrawStates. This improves performance of all draw call validation. The error that should be generated on the draw call is cached in the Context. The cache is updated in several places. Bug: angleproject:2747 Change-Id: I178617623731608e2e7166b53ab6489d8b742ff5 Reviewed-on: https://chromium-review.googlesource.com/1158612 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho d310a434 2018-08-24T15:40:23 Add validation and negative tests for multisample arrays This adds errors for binding and allocating multisample array textures. New tests in TextureMultisampleTest.cpp check that the errors are generated as specified. Tests for querying supported sample counts are also improved and extended for multisample array textures. BUG=angleproject:2775 TEST=angle_end2end_tests Change-Id: I6a0fe7ae04bb3d0072f6cbe09026b05e2bc47325 Reviewed-on: https://chromium-review.googlesource.com/1188576 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e7d80f33 2018-08-08T15:49:23 Refactor ValidateDrawBase. Split the parameter-dependent and parameter-independent validation. This will more easily let us cache independent validation in Context. Bug: angleproject:2747 Change-Id: I78a12798cd03a398392ca213bf51e2079295b97e Reviewed-on: https://chromium-review.googlesource.com/1158610 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 493f9571 2018-05-24T19:52:15 Add PrimitiveMode packed GLenum. Bug: angleproject:2574 Change-Id: I3d7bd7ca0d69a364a611dc04799ea34906fc4a6c Reviewed-on: https://chromium-review.googlesource.com/1067114 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill d4703d50 2018-05-24T17:31:43 Move packed enum code to common/ This makes it accessible in the utilities files. Bug: angleproject:2574 Bug: angleproject:2169 Change-Id: I0fdd34b4233e72b7534cb2b09f451539c1a394cd Reviewed-on: https://chromium-review.googlesource.com/1067110 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jiawei Shao 80c32ccb 2018-04-25T09:48:36 ES31: Add extra transform feedback rules in EXT_geometry_shader This patch adds the additional transform feedback rules required in EXT_geometry_shader. In this extension, more draw commands and render primitives are allowed for transform feedback. BUG=angleproject:1941 TEST=dEQP-GLES31.functional.geometry_shading.vertex_transform_feedback.* angle_end2end_tests Change-Id: Iedc27dca5c24ca45cd4226a1a0066107c0b40e1d Reviewed-on: https://chromium-review.googlesource.com/1055192 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Corentin Wallez ad3ae90a 2018-03-09T13:40:42 Use packed enums for QueryType. BUG=angleproject:2169 Change-Id: I129a9d8e295859daa071a298dab9fe1895315cc0 Reviewed-on: https://chromium-review.googlesource.com/957318 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 8ceea819 2018-04-10T03:07:13 Refactor packed enum generation to support EGL enums. Convert the very simple EGL texture type enum. BUG=angleproject:1618 Change-Id: Ieea382a282a8f2544f2982627e8445e6e5cea826 Reviewed-on: https://chromium-review.googlesource.com/1019386 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 427064d2 2018-04-13T16:20:34 Fix perf regression with checkStatus. Returning an Error was costing us performance in extra error checks. This intead uses the Context to process the Error immediately, and returns a value from isComplete and checkStatus. Improves performance in draw call validation. Bug: chromium:822235 Change-Id: I0793fc690e86137425fed593d45083e40aee8db9 Reviewed-on: https://chromium-review.googlesource.com/1011370 Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Brandon Jones 416aaf95 2018-04-10T08:10:16 Autogenerate ANGLE extension entry points Modify autogeneration script to pull data from gl_ext.xml and generate entry_points_gles_2_0_ext_autogen.cpp/h as a replacement for entry_points_gles_2_0_ext.cpp/h Bug:angleproject:2263 Bug:angleproject:1309 Change-Id: Ie21079f8ec5f85c657b891f6d6d59306a4c3b5fe Reviewed-on: https://chromium-review.googlesource.com/1005409 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Brandon Jones fe4bbe6c 2018-04-06T13:50:14 Create Stubs For Unimplemented Extensions Create context and validation stubs for unimplemented extensions. This will allow us to use an autogeneration script in the future to generate entry_points_gles_2_0_ext.cpp. Bug:angleproject:2263 Change-Id: If3ad3ebd823d65085c7f143cce9e09187e65d4da Reviewed-on: https://chromium-review.googlesource.com/998440 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Lingfeng Yang 038dd539 2018-03-29T17:31:52 GLES1: glMultiTexCoord4(f|x) BUG=angleproject:2306 + common validation for multitexturing units + clang-format Change-Id: I6eb456c273490e85fc7008e7e11d15e22dd20276 Reviewed-on: https://chromium-review.googlesource.com/987298 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>