src/libANGLE/renderer/gl/BlitGL.cpp


Log

Author Commit Date CI Message
Christopher Cameron b480ba30 2023-09-18T17:30:09 CopySubTexture: Fix premultiplied alpha When copying from an sRGB texture to a non-sRGB texture, un-do the sRGB-to-linear transform independently of the premultiply vs unpremultiply properties of the texture. The sRGB-to-linear transform performed during sampling is performed on the RGB part of the pixel, independent of the alpha channel's value. Un-do this part immediately before examining the alpha channel's value (and its premultiply vs unpremultiply state). Bug: angleproject:7907 Change-Id: I50c8f56182a46957febcd1f7b7887b0956074bb8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4872047 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: ccameron chromium <ccameron@chromium.org>
Christopher Cameron 5116f54e 2023-09-05T13:50:50 CopySubTexture: Handle sRGB source in GL backend CopySubTexture should ignore the color encoding of both the source and destination. The implementation currently ignores the color encoding of the destination. The implementation does not always ignore the color encoding of the source. As an example of the consequences of this, an RGBA pixel value of 0xFF/80/00/FF, when copied from a GL_SRGB8_ALPHA8 texture to a GL_RGBA8 texture may result in a value of 0xFF/37/00/FF, if the copy was executed using a shader (in which case the sRGB-to-linear function was applied 0x80, resulting in the 0x37). Update the OpenGL and shaders that do this blit, adding an option to apply a linear-to-sRGB transformation to undo the transformation applied by the sampler. The linear-to-sRGB transformation must be applied on unpremultiplied values. Ensure that the sequence of operations in all shaders is first unpremultiply, then linear-to-sRGB, then premultiply. Also remove optimizations to have the unpremultiply and premultiply cancel each other out, if there is also a linear-to-sRGB being applied. Bug: angleproject:7907 Change-Id: Iad5537e6b98f75d32a33be419a320129493e53a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4839262 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: ccameron chromium <ccameron@chromium.org>
Sunny Sachanandani 7bcd88cc 2023-07-06T15:44:44 gl: Do not propagate copyTexSubImage2D error to client https://chromium-review.googlesource.com/c/angle/angle/+/4662393 ensured that BlitGL::copyTexSubImage allowed the caller to fallback when the underlying copyTexSubImage2D call failed, but the GL error was also propagated to the client due to the Context::handleError call in CheckError - that error still causes webgl conformance failures even though the pixel expectations are now satisfied. This CL makes BlitGL::copyTexSubImage use getError directly so that the error is not propagated to the client. Bug: chromium:1458040 Change-Id: I3e4c06871c55d449facbe471c78e84f68b529f60 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4671325 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org>
Sunny Sachanandani 2a5c05df 2023-07-05T14:24:54 gl: Handle copyTexSubImage2D failures manually https://chromium-review.googlesource.com/c/angle/angle/+/4662093 was a previous attempt at graceful fallback from copyTexSubImage2D, but the approach in that CL doesn't quite work since it produces an error when returning from the function which makes the caller also propagate the error instead of falling back to blit via shader. This CL makes it so that we handle the error manually and return an angle::result::Continue with *copySucceededOut=false to indicate to the caller that it should try a fallback. Bug: chromium:1458040 Change-Id: I3cd66dcaa6069d5527c3e73190d72ffbba98ae4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4662393 Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Sunny Sachanandani e70b9b4f 2023-06-26T14:03:54 gl: Use ANGLE_GL_TRY_ALWAYS_CHECK for CopyTexSubImage CopyTexSubImage fails with certain formats on Pixel 2 & 4 with a driver error. TextureGL::copySubTextureHelper has a fallback path to handle errors, but it gets skipped because BlitGL::copyTexSubImage uses ANGLE_GL_TRY which doesn't check for GL errors in release builds. This CL fixes that by using ANGLE_GL_TRY_ALWAYS_CHECK instead which is anyway intended for any GL call that might allocate memory behind the scenes. Bug: chromium:1458040 Change-Id: If660f3ef9968338d4ecf7fa20ab481aad84ed981 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4662093 Auto-Submit: Sunny Sachanandani <sunnyps@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi ccf8530b 2023-06-27T16:01:58 Split context state by locality of get/set effect Some state are purely local to the context when get or set. For example, the state of depth test does not affect and is not affected by any other state. Some state on the other hand may affect other contexts. In particular, some objects are shared between contexts of a share group, and may affect each other through the observer interface. These sets of state are separated to create a clear boundary between state that can and cannot be accessed without holding the share group lock. A follow up change removes locking from the entry points that purely access the former set of states. For the latter state, it is likely possible to access most if not all of them without holding a lock, but careful inspection is required before that can be considered. In particular, most entry points that simply bind an object are likely harmless if the ref counter is turned atomic. Bug: angleproject:8224 Change-Id: I91c3fa9de870c13d48012a5e06c177dab4010907 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4651375 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov 21f16cb1 2023-06-09T17:30:38 Disable clang-format on ANGLE features autogen outputs Updates the script to produce reasonably formatted code without clang-format. Autogen files moved to autogen/ sub-directories because clang-format does not support per-file settings ;( This allows to run this codegen very quickly (~50ms on my machine) Bug: angleproject:8193 Change-Id: Ie84282090d574ebb4debe3edcfd82f983f27a5ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4604578 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 73f9cf00 2023-03-31T00:00:00 GL: Implement polygon mode extensions * Implemented polygon mode extensions on the OpenGL backend * Supported capture and serialization of the new commands and state * Added PolygonModeTest end2end tests Bug: angleproject:1791 Bug: angleproject:8132 Change-Id: I3bc08546a02f110dd739950129bee25ccc507bf6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4492683 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang da7dd31f 2023-03-27T11:29:10 GL: Disable extended dirty bit states for internal blits. New GL states have been added to the GL backend and not updated in ScopedGLState which is used to reset internal state for blits. This caused test failures when tests were run in specific orders. Ex: ClipDistanceTest.ThreeClipDistancesRedeclared/ES2_OpenGL:CopyTextureVariationsTest.CopySubTexture/ES2_OpenGL__AToBGRAFlipYUnmultiplyAlpha Bug: angleproject:5160 Bug: chromium:1410191 Change-Id: I805e39bc8c4c7d7d843b43fdc7813dd668919e8a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374101 Reviewed-by: Peng Huang <penghuang@chromium.org>
Alexey Knyazev 1174582a 2023-03-06T00:00:00 GL: Implement EXT_clip_control The extension is trivially exposed if the current context supports it. * Added packed clip control enums * Removed unused state query code * Aligned symbol names with the specs Bug: angleproject:8066 Change-Id: I9d106f39800658ecc75f4525ee93cb534dc49f9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4306770 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 7cb0622c 2022-06-30T00:00:00 BlitGL: Fix LUMAWorkaround for half-float copies Use desktop HALF_FLOAT enum when running on desktop OpenGL. Bug: angleproject:5038 Change-Id: I829f28ca51caa1f98b653d1a456ed775f8d362cb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3738261 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Eddie Hatfield 91976352 2022-06-21T15:41:02 Use C++17 attributes instead of custom macros Bug: angleproject:6747 Change-Id: Iad6c7cd8a18d028e01da49b647c5d01af11e0522 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3718999 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 400d9fe4 2022-04-23T01:08:19 Rename feature files to *_autogen.h To clarify further that they are not to be edited by hand. Bug: angleproject:6435 Change-Id: Iaf79706d2b688a43b3ebb65700cfbdd71a49a742 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3603842 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 2dd13ebb 2022-04-21T11:25:00 Track Surface color & depth/stencil init separately. This clears up some trace testing confusion due when robust resource init is enabled, and the app clears color but not depth on the default surface. Bug: angleproject:7221 Change-Id: Id97871aec32ad831b663aaa9116e04b582ab5a36 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600375 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Nathan Zabriskie 9d486a85 2022-04-01T11:48:58 GL: Unbind textures from FBO after calls to frameBufferTexture2D OOPR canvas uncovered an Nvidia driver bug in which binding a texture level > 0 to a framebuffer and then later binding a renderbuffer to the same FBO causes the FBO to be marked as having an incomplete attachment. This CL expands UnbindResources() in BlitGL.cpp to unbind textures in addition to RBOs and adds new calls to unbind in functions that call framebufferTexture2D. Also adds a GL workaround--alwaysUnbindFramebufferTexture2D-- that forces FramebufferGL to first unbind any existing attachments using framebufferTexture2D before attaching a new render buffer. Bug: angleproject:5536 Change-Id: I46c115b3895f8fccb251dbf4531d5c1bd4705ebc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3527465 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Shahbaz Youssefi 7a85d114 2022-03-25T15:01:17 Use [[nodiscard]] on RAII classes Scoped* classes provide an RAII way of adding cleanup/restore state/etc in a robust way. Unfortunatley, it's very easy to mistakenly leave the variable name, leading to the destructor being called immediately instead of at the end of the scope: { ScopedX(parameters); // instead of ScopedX x(parameters); // Code here is run after destructor } The [[nodiscard]] attribute, if specified on the ScopedX class would lead to a warning (turned to error with -Werror). This change does that for classes named *Scoped* in ANGLE. Bug: chromium:1103817 Change-Id: I65c9922c9b4eba1f9c033e093fe8fe534648ab62 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3552092 Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e84b0154 2021-09-13T16:04:20 Update extension boolean names. This is in preparation for auto-gen, which uses a simple naming scheme. This fixes the bool names to be totally consistent with the extension names. Bug: angleproject:6379 Change-Id: Ia212449be04accb0e4f006b55b1813ab4481fa0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3157417 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang de09f8db 2021-09-02T18:21:37 Revert "GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY" This reverts commit 4b5a774e855af2493d64b0635f56053bd795c5c5. Reason for revert: broken on iOS and Skia Original change's description: > GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY > > Bug: angleproject:3020 > Change-Id: Iff460a1012d06e1c5feff84d91117de87e7c870a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3123167 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: angleproject:3020 Change-Id: I54d81a7b734d007f65ff97990008f5e6eb8536f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140453 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 4b5a774e 2020-04-03T14:56:36 GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY Bug: angleproject:3020 Change-Id: Iff460a1012d06e1c5feff84d91117de87e7c870a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3123167 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang f3bccd9d 2021-08-26T18:04:13 Revert "GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY" This reverts commit 8d7f4cc986778bfff0b242dbea6083346da6c54d. Reason for revert: Broke CrOS build. Original change's description: > GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY > > Bug: angleproject:3020 > Change-Id: If60448f80daaeeb1503b41db8ac309e45923fd13 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135929 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:3020 Change-Id: I0930c1bdb5356d533fae563428893aa8a9f91a52 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3123266 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Geoff Lang 8d7f4cc9 2020-04-03T14:56:36 GL: Update StateManagerGL binding funcs to use ANGLE_GL_TRY Bug: angleproject:3020 Change-Id: If60448f80daaeeb1503b41db8ac309e45923fd13 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135929 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 15581f35 2021-07-13T15:01:56 Fix the INVALID_ENUM error This PR fixes the GL_INVALID_ENUM error caused by framebufferTexture2D in copySubTextureCPUReadback with TEXTURE_EXTERNAL_OES as the texture target. TEST conformance/textures/video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html conformance/textures/video/tex-2d-luminance-luminance-unsigned_byte.html conformance/textures/video/tex-2d-alpha-alpha-unsigned_byte.html conformance2/textures/video/tex-2d-srgb8-rgb-unsigned_byte.html conformance2/textures/video/tex-2d-rgb9_e5-rgb-float.html conformance2/textures/video/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html conformance2/textures/video/tex-2d-rgb9_e5-rgb-half_float.html conformance2/textures/video/tex-2d-rgb16f-rgb-float.html conformance2/textures/video/tex-2d-rgb16f-rgb-half_float.html conformance2/textures/video/tex-2d-rgb32f-rgb-float.html Bug: chromium:1208297 Change-Id: Ic62ba95ad6fd70f293a7261dc640a95dcabe7ba2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3023666 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Geoff Lang 18c6d628 2021-03-09T13:46:13 GL: Support VAOs without native VAOs. Share the default VAO state between all frontend VAO when there is no native VAO support. Forcefully sync state every time a new frontend VAO is bound. Bug: angleproject:5577, chromium:1167179 Change-Id: Ieaedb5108ad28fc78e7e58b74495639c5246bb05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2665266 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Peng Huang <penghuang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 25bbf5d7 2020-04-03T11:58:13 GL: Use ANGLE_GL_TRY when setting pixel pack and unpack state. Bug: angleproject:3020 Change-Id: Ifd36973d66c850d0d0520d9721ab9e5294489b39 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134424 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 266f4429 2020-10-15T15:53:44 Cache BlitGL initialization state with a single bool. We used to cache initializatin per-resource and check each one for every operation. This was slower and more error prone, the mSRGBMipmapGenerationFormat was computed every time. Found when diagnosing crbug.com/1136613 Bug: chromium:1136613 Change-Id: Ifd804fe1dc8e26e1a9b444cc1d0c6f73954da895 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477037 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
James Darpinian 336e8915 2020-05-29T16:09:47 Workaround broken copyTexImage2D on iOS Use BlitGL to reimplement copyTex[Sub]Image2D on iOS. Bug: angleproject:4674 Change-Id: Ie3018d6d33da57797162922410f76557124df4b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2222718 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 60803838 2020-05-20T17:24:49 GL: Work around drivers that generate mipmaps in linear color space Mac drivers generate mipmaps in linear color space. To work around this, copy the sRGB texture to a linear texture, generate mipmaps and then copy back. TEST=conformance2/textures/misc/tex-srgb-mipmap.html BUG=angleproject:4646 Change-Id: I8675d0ab004bcd2985f685d64cbb84deff5f1c86 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2211083 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 22aba328 2020-05-20T10:59:56 Don't write alpha when blitting to a framebuffer with emulated alpha. Emulated alpha framebuffers should never modify the alpha channel. Our blitting code didn't take this property into account. TEST=conformance2/rendering/blitframebuffer-resolve-to-back-buffer.html BUG=angleproject:4645 Change-Id: I1797934df7e7aa520bacfba8a379f6545e38753e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2210023 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: James Darpinian <jdarpinian@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang a2ece533 2020-05-12T12:20:00 GL: Use a valid internal format for CopyTexImage in BlitGL::blitColorBufferWithShader The frontend format is not always valid to use for glCopyTexImage. Translate it to a valid format for the current driver. TEST=deqp/functional/gles3/framebufferblit/default_framebuffer_00.html BUG=angleproject:4632 Change-Id: I838a1b27b528f074f440575adb88357a910f596a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2196842 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill c916fe8a 2020-04-02T16:57:49 Don't call syncState inside FBO queries. This prevents a syncState ordering issue that was confusing FBO sync when robust resource init is enabled. Also cleans up some redundant format processing for the half float extensions. Bug: angleproject:4517 Change-Id: Ieb13fc5203cf824a3e8affda96ea5cbbd89d78ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134411 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 60a396a8 2019-11-07T16:36:45 Reset texture swizzle state to default after LUMA workaround The copySubImage LUMA workaround sets special TEXTURE_SWIZZLE_RGBA values to work. However, it must reset this parameter back to the default state after the workaround completes. Bug: 1022080 Change-Id: I84870f1264311c106ebece1e6a37d5f92a1da28c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1904627 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Geoff Lang c2fc8bd8 2019-10-01T18:21:22 GL: Fix support for glCopyTextureCHROMIUM with source rectangle textures. Shader generation didn't use the correct sampler type and discarded pixels outside the [0, 1] texcoord which is almost always true when sampling rectangle textures. Added end2end test coverage. BUG=990368 Change-Id: Ifaa73dfa83467d5bfa32e3795b52033254436a77 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1834582 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 901aa3fa 2019-10-01T18:03:06 GL: Refactor BlitGL program types into tuples of enums. Previously we expanded out all the program variations into individual enums but as we add more variations this becomes hard to maintain. Generate the BlitGL program based on the individual parameter instead. BUG=990368 Change-Id: I94fd5132baa5b6828aec7823ca5d9f0ffe94379f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1834581 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 4e57520a 2019-08-23T16:14:07 GL: Update BlitGL to use ANGLE_GL_TRY. BUG=angleproject:3020 Change-Id: I587e638ca9dea2cb84aaad68aa8d1ce32fc62053 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769062 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2a19c59f 2019-08-23T14:10:24 GL: Check for errors around GL calls. Add a macro to check for GL errors after each GL call to catch errors as they happen even if the debug callbacks are unavailable. GL errors are only checked when asserts are enabled unless explicitly requested with the ANGLE_GL_TRY_ALWAYS_CHECK macro to verify GL calls that may allocate memory. Updated TextureGL to use the macro. BUG=angleproject:3020 Change-Id: I7678b204899e940824b010ab4be7e7f159bee6de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1764476 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang b3eeb2a4 2019-08-05T17:02:43 Emulate RGB textures using BGRX IOSurfaces. When the user requests an IOSurface Pbuffer with an RGB format, emulate the missing alpha channel by clearing it to 1.0 and masking reads and writes in shaders. BUG=angleproject:3766 Change-Id: I58c992bf641d9ece0f923603f32640615150e4f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1737437 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Geoff Lang 369f9e5d 2019-07-30T13:46:14 GL: Support Rectangle textures as sources for glCopyTextureCHROMIUM. Chrome uses rectangle textures on mac to copy data. ANGLE's frontend allowed them as CopyTexture sources but did not implement them in the backend. TEST=Any WebGL test on Mac BUG=982294 Change-Id: If2e40292b22c4f49676e3ece8cc6fa126c5b7b94 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1726849 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 4e71b2bc 2019-07-08T13:23:38 Framebuffer: Clean up query naming. Changes instances where we were querying 'color buffers' and 'depth buffers' to 'color attachments' and 'depth attachments', etc. Bug: angleproject:3611 Change-Id: I7af7d33e5204f21d288f5bcad997988d36eabfc5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1690679 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Geoff Lang 235e56fb 2019-06-27T11:28:31 BlitGL: Support CL readback from non-renderable textures. External textures are often not renderable for the CPU readback path. Instead, copy them into a renderable texture and then read them back. BUG=906724 Change-Id: I61bd0a9d51c4b24e1d285b5f1883e01ccb53ebea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1680053 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jonah Ryan-Davis beb0eb2d 2019-06-14T15:10:33 Clean up workarounds/features to single location. Rename all workarounds structs to features, and move the lists to a shared location in include/platform (to help with documentation, see: https://cs.chromium.org/chromium/src/ui/gl/gl_switches.cc?sq=package:chromium&g=0&l=69) Bug: angleproject:1621 Change-Id: I4069f08131db5e886047a007efb5d7764dfee5f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1660952 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 5a808b86 2019-05-27T13:22:32 GL: Allow BlitGL to copy from external textures. BUG=967410 Change-Id: I503dda6f2493b56123a8bd369e2f1305971abb4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1364110 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jiawei Shao e794ddc8 2019-05-10T11:05:10 OpenGL: Remove all attachments before executing internal clear This patch fixes a bug in BlitGL::clearRenderbuffer() by removing all the attachments of mScratchFBO before attaching the real target of clear to keep mScratchFBO always being incomplete. Without this fix, the WebGL CTS tests mentioned in issue 2760 will fail on Intel OpenGL drivers when Chromium is using pass through command buffer because when a multisampled depth renderbuffer is attached to mScratchFBO, mScratchFBO will sometimes become incomplete because it may already have a non-multisampled color attachment. Bug: angleproject:2760 Test: angle_end2end_tests Change-Id: Id206fb4b338545ab46aba118e80d288158dcd8ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1612305 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c3dc5d48 2018-12-30T12:12:04 Merge gl::Context and gl::ContextState. This reduces the number of indrections when accessing the Extensions or Caps structures. It will provide a small speed-up to some methods. It also cleans up the code. Bug: angleproject:2966 Change-Id: Idddac70758c42c1c2b75c885d0cacc8a5c458685 Reviewed-on: https://chromium-review.googlesource.com/c/1392391 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Markus Tavenrath <matavenrath@nvidia.com>
Geoff Lang be607ad6 2018-11-29T10:14:22 GL: Implement GL_OES_EGL_image_external and GL_OES_EGL_image_external_essl3 Chrome uses external textures as part of its hardware video decode paths on Android. BUG=angleproject:2507 Change-Id: I2af608f84a99843c99a16dcfb9fb2fa28cc8fbb6 Reviewed-on: https://chromium-review.googlesource.com/c/1361480 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 7c985f5c 2018-11-29T18:16:17 Make angle::Result an enum. This moves away from a class type to a value type. This should improve performance when using angle::Result as a return value. Previously the generated code would return a pointer instead of a value. Improves performance in the most targeted microbenchmark by 10%. In more realistic scanarios it will have a smaller improvement. Also simplifies the class implementation and usage. Includes some unrelated code generation changes. Bug: angleproject:2491 Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa Reviewed-on: https://chromium-review.googlesource.com/c/1356139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 526392dd 2018-11-16T09:35:14 Use angle::Result in front-end (Part 9) This removes the ANGLE_TRY_HANDLE macro. Also the internal uses of gl::ErrorStreamBase. There are remaining uses in the validation code. Further progress will be blocked on removing egl::Error and the use of gl::Error in the validation layer. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: I3e0481f99738f9f24256c10e73f3efcce9826a35 Reviewed-on: https://chromium-review.googlesource.com/c/1334427 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill e39e8f46 2018-10-05T08:17:38 GL back-end error refactor. Adds explicit error handling to a few scoped state handler classes. Otherwise mostly mechanical refactoring. Bug: angleproject:2753 Change-Id: I2bf969a68f45880902b6e7902297c1340a76a1c4 Reviewed-on: https://chromium-review.googlesource.com/c/1255647 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Brandon Jones 4e6f2aea 2018-09-19T11:09:51 Implement ANGLE_copy_texture_3d Extension Adds copyTexture3DANGLE and copySubTexture3DANGLE that adds copy operations on volumetric textures. Bug: angleproject:2762 Test: angle_end2end_tests Change-Id: I0076989c2b7ed69abfc73143c325065bdb06a360 Reviewed-on: https://chromium-review.googlesource.com/c/1207216 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1395134c 2018-09-30T15:24:28 Remove more uses of gl::ErrorOrResult. Only gl::LinkResult remains. Bug: angleproject:2753 Change-Id: I5e9c68c11453e8ab9db4908451957d7b3db0b110 Reviewed-on: https://chromium-review.googlesource.com/c/1254044 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 522095f7 2018-07-23T14:59:41 Rename "color" functions to "pixel" functions. This extends of the copy, read and write functions to cover depth and stencil formats. Refactoring change only. Bug: angleproject:2673 Change-Id: I4b0b2f4cf8621051cacd95cdbd6d70f94ca612e2 Reviewed-on: https://chromium-review.googlesource.com/1147152 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ba365939 2018-07-18T17:23:46 Rename angle::Format::ID to angle::FormatID. This allow for predeclaring the enum. It solves some include dependency issues. Bug: angleproject:2729 Change-Id: Ibbbab0796e466c62848404ba277c5f454fd9ac62 Reviewed-on: https://chromium-review.googlesource.com/1142299 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill dec86230 2018-07-11T09:01:18 Generalize Context scratch buffer errors. This refactor will allow us to generate different error types in different backends. This makes Vulkan happy because it won't have to generate gl::Errors and can stay with vk::Error. Bug: angleproject:2713 Change-Id: I981402450f3b519d4f79851982547695d583355a Reviewed-on: https://chromium-review.googlesource.com/1128921 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Geoff Lang 2cb7f974 2018-05-07T13:49:13 GL: Refactor TextureGL to not hold renderer objects. BUG=angleproject:2464 Change-Id: I24b07557d90988369bc8b7e4b2fe3a500ab7bc36 Reviewed-on: https://chromium-review.googlesource.com/1048115 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 47155b17 2018-04-26T12:14:10 Clean up BlitGL Simplify handling of reversing the blitted area and calculate shader parameters in a way that doesn't require lengthy explanation. BUG=chromium:830046 TEST=angle_end2end_tests Change-Id: Ie9bce812be4ef04a969153fc7c484039fc48a198 Reviewed-on: https://chromium-review.googlesource.com/1030172 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 00689191 2018-03-27T17:34:20 GL: Fix the CPU readback path of CopyTextureCHROMIUM. 1. BlitGL's resources were not being intialized. 2. The format/type information was not enough to know if the destination texture was SRGB. BUG=693090 Change-Id: I3fc277a175772d3b6acace1810cb43f4a9bdc473 Reviewed-on: https://chromium-review.googlesource.com/982642 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill cc129377 2018-04-12T09:13:18 ImageIndex: Consolidate layer/cube face. In terms of the Texture or Image resource, a cube face refers to a layer of a 2D texture. This layer has a special meaning for cube textures, but it is represented as a layer with a layer index. Cube array textures are no different, they just use a different indexing scheme for the array layers. This also cleans up the ImageIndex helper to have a class structure with private data, and cleans up a few cases to use generic Make functions and iterators where they were setting properties of the index directly. This will make it easier to have ImageIndexes address entire levels of a Cube map in the future, and makes the layer count logic in Vulkan cleaner. Bug: angleproject:2318 Change-Id: Iea9842e233f974a9896282ca224cb001f7882bd1 Reviewed-on: https://chromium-review.googlesource.com/987525 Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 2231b4e0 2018-03-26T16:44:59 Add a FixedVector class to have "variable" size vectors on the stack. Wraps a std::array and a size parameter to give the std::vector interface without making allocations. BUG=angleproject:2435 Change-Id: I7df0be1310446a2f163766149bf631a8692be9ad Reviewed-on: https://chromium-review.googlesource.com/981267 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 13e31bb0 2018-03-27T15:03:36 GL: Check framebuffer completeness before running blit shaders. Cube map destination textures may not be complete until all faces have been initialized. BUG=693090 Change-Id: I19816c9def3b9663491397cded5d24ca808a3f78 Reviewed-on: https://chromium-review.googlesource.com/982393 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 3cd48fff 2017-10-03T15:37:16 Implement robust resource initialization for OpenGL. BUG=angleproject:2107 BUG=angleproject:2407 BUG=angleproject:2408 BUG=693090 Change-Id: I6444f80f9703d6341f2ec67518050adc88f71d96 Reviewed-on: https://chromium-review.googlesource.com/678482 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 690c8eb7 2018-03-12T15:20:03 Framebuffer: syncState before internal format query. Since querying the internal format of an attachment might need ot look at the RenderTarget for some back-ends, or otherwise flush attachment changes, we should call syncState internally. This means that we can't mark these queries as const. Bug: angleproject:2372 Change-Id: I9bfb43a472bcd7dfdd6ea7fab4751d494e1126bb Reviewed-on: https://chromium-review.googlesource.com/948784 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@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 336129f6 2017-10-17T15:55:40 Use a packed enum for buffer targets. BUG=angleproject:2169 Change-Id: I4e08973d0e16404b7b8ee2f119e29ac502e28669 Reviewed-on: https://chromium-review.googlesource.com/723865 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez cda6af19 2017-10-30T19:20:37 Split pixelBuffer from pack/unpack state This will refactor will help use packed enums for buffer targets. BUG=angleproject:2169 Change-Id: Ie7ed3e105f89457c67027e6598d7e29503ad355c Reviewed-on: https://chromium-review.googlesource.com/745181 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
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>
Geoff Lang 47bb4933 2017-08-03T11:52:13 Implement CopyTexture functions for uint texture formats. BUG=angleproject:1932 Change-Id: I6474237cbb82b59a0bd40c1b9b9e2455952d3755 Reviewed-on: https://chromium-review.googlesource.com/600510 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang acd20b1f 2017-08-02T16:39:27 Refactor BlitGL to potentially hold multiple blit shader types. BUG=angleproject:1932 Change-Id: I4d19892852540797c765916131498c96511b4f55 Reviewed-on: https://chromium-review.googlesource.com/600509 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: 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>
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>
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>
Geoff Lang ca27139e 2017-04-05T12:30:00 Key the format tables on internal format and type. Keying the format tables on internal format alone is not enough to fully validate the unsized formats which require additional type information. This CL has no functional changes, it just splits the tables and updates the calls to GetInternalFormat info to provide type information when the format is not sized. BUG=angleproject:1523 BUG=angleproject:1958 BUG=angleproject:1228 Change-Id: I37e5201e7f54fa8eca01b8a6e64b11a6b94484e7 Reviewed-on: https://chromium-review.googlesource.com/468449 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang fc72a073 2017-03-24T14:52:39 Update CHROMIUM_copy_texture entry points to the ES3 versions. BUG=angleproject:1932 Change-Id: Ia45f8522320af1d747fbfb57468e8b881b033543 Reviewed-on: https://chromium-review.googlesource.com/459101 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang a20fc005 2016-08-08T15:19:56 Implement GL_CHROMIUM_sync_query for GL. BUG=angleproject:1366 Change-Id: I9e44679754eb704b390191c28206dedc3dc7cc4f Reviewed-on: https://chromium-review.googlesource.com/367082 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 922cbfcb 2016-11-25T16:23:18 common: Add a vector arithmetic helper classes Change-Id: I2f96baedf10d346eaa150bab04f8f6ca3ba573b9 Reviewed-on: https://chromium-review.googlesource.com/414272 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 133a2ecb 2016-11-17T16:28:03 Implement CHROMIUM_copy_texture for OpenGL. This also makes BlitGL work correctly on OpenGL ES (provided vertex arrays are available) BUG=angleproject:1356 Change-Id: Icb7cef35bebfe6672220aa0b312ab89187dbf585 Reviewed-on: https://chromium-review.googlesource.com/412452 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez e85587ac 2016-11-17T16:25:44 BlitGL: add a ScopedGLState to separate our state from the app's BUG=angleproject:1356 Change-Id: I19ec4efa37d142ac7370815b078f4ba79caa0bea Reviewed-on: https://chromium-review.googlesource.com/412451 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez dd9e6396 2016-11-16T13:27:56 BlitGL: handle copyTexImage3D for the luma workaround BUG=angleproject:1492 Change-Id: Ica9a7c72f0e463850dd93f4a15d9b572fb10a1f6 Reviewed-on: https://chromium-review.googlesource.com/412054 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 26a717b0 2016-09-27T08:45:42 GL: Emulate SRGB blits where needed. Desktop OpenGL before 4.4 doesn't handle SRGB blits the same way OpenGL ES does. Emulate them by drawing a quad. BUG=angleproject:1492 BUG=chromium:634525 Change-Id: I9f2992d9b373941b10f19f8a51564f0f756cc4df Reviewed-on: https://chromium-review.googlesource.com/389853 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 6a0e4e52 2016-09-22T17:03:09 BlitGL: orphan scratch textures when we are done. This will allow the OpenGL driver to reclaim GPU memory. BUG=angleproject:1512 Change-Id: If063e1ff9f4a544012ca78c37e198054cb4edcac Reviewed-on: https://chromium-review.googlesource.com/388771 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang bf8a72f6 2015-11-03T16:34:45 When doing a LUMA blit, render to an intermediate texture. Instead of rendering the swizzled result to the destination texture, render to another intermediate texture and then CopyTexImage it into the destination texture. Rendering to arbitrary mip levels of the destination texture is not always supported but CopyTexImage-ing is. BUG=angleproject:1113 Change-Id: I352a1fcc769ce92268744d3e7a6265dd2bfddb37 Reviewed-on: https://chromium-review.googlesource.com/310570 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang e453dd31 2015-08-27T10:38:07 Fix warning about initialization order in BlitGL. BUG=angleproject:1113 Change-Id: I808d521ffc257c2f45badbbd462698f91def314f Reviewed-on: https://chromium-review.googlesource.com/295830 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 53b8aec0 2015-08-24T10:33:25 Work around deprecated LUMA formats in the core profile. Use R and RG textures with swizzle states to emulate them. A manual blit is required when calling CopyTex[Sub]Image from a RGB[A] framebuffer to an emulated L[A] texture so that the alpha channel ends up in the correct channel of the destination texture. Fixes the following tests when using the core profile: * conformance/extensions/oes-texture-float.html * conformance/extensions/oes-texture-half-float.html * conformance/textures/misc/tex-sub-image-2d.html * conformance/textures/misc/texture-formats-test.html * conformance/textures/misc/texture-npot.html BUG=angleproject:1113 Change-Id: If5540e66d9017596bd83d95ec3ede043cbcfe0d2 Reviewed-on: https://chromium-review.googlesource.com/293905 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>