src/libANGLE/renderer/gl/FramebufferGL.cpp


Log

Author Commit Date CI Message
shrekshao 81ee4d29 2019-12-04T17:05:11 Workaround EXT_texture_norm16 for OpenGL ES drivers Implement a workaround for widespread bugs calling glReadPixels with RGBA/UNSIGNED_SHORT against R16/RG16 color attachments. Read back the data using the GL_IMPLEMENTATION_COLOR_READ_FORMAT, and then rearrange the read back pixels to fit the RGBA layout. Also skip RGB16/RGB16_SNORM texture sample test on Nexus 5X/Nexus 6P due to a another driver bug. Bug: chromium:1000354, angleproject:4214, angleproject:4215, angleproject:4245 Change-Id: Iedea6f4136878cac5ad0dec3757c77b73502e1cd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1952166 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
Geoff Lang e4ac2ff3 2019-11-28T16:30:15 GL: Make GL_EXT_texture_format_BGRA8888 enableable. Disable returning BGRA as an implementation read format unless GL_EXT_texture_format_BGRA8888 is exposed. WebGL doesn't support this extension and returning BGRA as an implementation read format is invalid. TEST=functional/gles3/negativebufferapi.html TEST=functional/gles3/integerstatequery.html BUG=angleproject:4179 Change-Id: I313721f09da0e455128b88b129bd34338d47af73 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1943407 Reviewed-by: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
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>
Mingyu Hu 7e44ec26 2019-08-26T15:59:48 GL_EXT_multisampled_render_to_texture extension. Part 1. Adding new parameters for extension without adding any real code change. Since no new code paths were added, we expect all tests to pass as before. Bug: angleproject:980428 Change-Id: I551b46a66f422eabd357fd021e00cf266a991efb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1772377 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: 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>
Jonah Ryan-Davis 0716ce0a 2019-07-22T15:20:47 Re-add case to blitframebuffer workaround where src is outside of bounds. On Mac, blitFramebuffer calls fail if the source region is not enclosed by the framebuffer. In this case, we must naively clip the source region and adjust the dest region accordingly. This is slightly different behavior and may cause issues with scaling so we use a separate workaround. Also, Windows NVIDIA has a driver bug that affects Vulkan device creation after blitting large textures, so it should be included in the original workaround. This CL cleans up the workaround to use more helpers from ANGLE and to generally improve readability. Bug: chromium:830046 Change-Id: I50bd97449725b738036e6bd3af82362020d7eda8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713090 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 7151fe54 2019-07-17T15:15:27 Port adjust_src_dst_region_for_blitframebuffer workaround to ANGLE. BlitFramebuffer has issues on some platforms with large source/dest textures. As per the WebGL2 spec, this was caught with validation for sizes over 2^32, but there is a specific issue on Linux NVIDIA where it fails on sizes over 2^16. A better workaround (from chromium), resizes the blitframebuffer call based on the framebuffer size. Bug: chromium:830046 Change-Id: Ic6196db6228d0d0ac92b12a68bbced76dcbcdf8c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1707115 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
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>
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>
Jamie Madill 6722009e 2019-05-20T11:12:53 Vulkan: Handle dirty RTs with state messages. Prior to this CL we were handling dirty state change notifications by flushing the RT Images just prior to use or just after they were changed. This could lead to a few redundant checks in several places. It also meant we needed an owner pointer from the RT to the parent Image. This pointer would be null for Surfaces and Renderbuffers. This cleans up the image flushing logic to be handled by dirty bit notifications. When an app updates an attached Texture with TexSubImage or related calls it will send a notification to the Framebuffer. The Framebuffer then sets a dirty contents bit that is handled in the implementation. In Vulkan this means flushing the dirty bits. Requires adding a flag to the FramebufferImpl class to determine if we need to syncState before we checkStatus. Adding the option allows us to only call syncState for the GL back-end. Not calling syncState allows the robust resource init operation to happen *before* we syncState. Which in turn allows FramebuffeVk to initialize the VkImages in one go. Added new regression tests for Texture updates. This might not cover all cases. I found it was very hard to trigger some of the resource update staging in TextureVk. Bug: angleproject:3427 Change-Id: Idfa177436ba7fcb9d398f2b67922e085f778f82a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1601552 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jonah Ryan-Davis 776694cd 2019-05-08T10:28:55 Change all ANGLE workarounds to use struct definition with info. Change each workaround from a simple bool to a struct with info including name, workaround set, description, and bug IDs. This will help with future workaround integration with Chrome. Bug: angleproject:1621 Change-Id: Ia27c180abaf845e280060c803e5994cc3152a057 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593917 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
shrekshao 15ce8227 2019-03-18T19:25:21 Fix error report when active color buffer has no fs output Also modify or remove some tests to sync up with the expected behavior stated in spec. Related to https://github.com/KhronosGroup/WebGL/pull/2780 If any draw buffer with an attachment does not have a defined fragment shader output, draws generate INVALID_OPERATION. Also remove Framebuffer masking for inactive outputs. This workaround is no longer necessary as the WebGL spec has changed. It also was never fully working and had bugs with certain orders of calls. Bug: angleproject:2872 Bug: chromium:927908 Bug: chromium:943538 Change-Id: I73715a6ab851ae3db7096f49ea0a9fdd6f576703 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1530018 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Mingyu Hu 7d64c486 2019-03-12T14:27:40 GL_ANGLE_multiview has been renamed to GL_OVR_multiview2. changes include: 1) GL_OVR_multiview to GL_OVR_multiview2 extension directive change 2) Removal of all references to side by side. We no longer support multiple views in a single 2DTexture. Only 2DTextureArray's are supported 3) WebGL 2 (ES3) is required for multiview Bug: angleproject:3341 Change-Id: Ie0c1d21d7610f8feebdb2e4d01c6947f57e69328 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552023 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.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>
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 f38cb6d3 2018-10-22T11:53:40 StateManagerGL: Optimize state application. There are two main optimizations: 1. Inline setDraw*State and maskOutInactiveOutputDrawBuffers. 2. Remove Multiview dirty bits. The first change is a refactoring only. It moves the code around a bit so we can hit a fast path and never have to push/pop registers. The second change is also a no-op since the multiview dirty bits were made redundant. Improves performance in the command buffer perftests by 1-5%. Bug: angleproject:2877 Change-Id: I1632a838371ec8b85c2e06b3b86f08727ca9dacf Reviewed-on: https://chromium-review.googlesource.com/c/1293629 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 64b7c4ff 2018-10-19T11:38:04 Use angle::Result in front-end (Part 3) Handles the gl::Framebuffer class and its implementation. Bug: angleproject:2491 Change-Id: I3b9c0609e9277264ccdb370596500562df3b7d15 Reviewed-on: https://chromium-review.googlesource.com/c/1280743 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6f755b21 2018-10-09T12:48:54 Use angle::Result in front-end. (Part 1) This covers most of the hot paths used in draw calls. Gives in the order of a 5% reduction in draw call overhead. Bug: angleproject:2491 Change-Id: I2d53afb1163eaceed61fb9cd9ce6c1267c85c0fa Reviewed-on: https://chromium-review.googlesource.com/c/1258149 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
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>
Olli Etuaho dff32a0d 2018-08-28T14:35:50 Support multisample arrays in shader programs The added tests check that using textureSize() and texelFetch() on textures with a fixed point format return expected results. texelFetch is also covered for integer format textures. dEQP GLES 3.1 tests also cover a variety of multisampled array texture formats. BUG=angleproject:2775 TEST=angle_end2end_tests, angle_deqp_gles31_tests Change-Id: I99b422e24b39e3563ed72f0fb85c9c1907df807d Reviewed-on: https://chromium-review.googlesource.com/1196521 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho fd162107 2018-08-27T16:14:57 Support multisample arrays as framebuffer attachments This contains tests for framebuffer completeness when layers of multisample array textures are attached. Simple clearing of a layer of a multisample color texture array and blitting the result to a non-multisampled texture is also covered. BUG=angleproject:2775 TEST=angle_end2end_tests Change-Id: Idf383cab69587dbd8157ab9a2b7c47e5a90b3cf7 Reviewed-on: https://chromium-review.googlesource.com/1190184 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill ca2ff38b 2018-07-11T09:01:17 Refactor internal format pixel math methods. This removes the use of the ErrorOrResult class from these methods. This will enable more performant Error handling. Also cleans up the ANGLE_TRY_CHECKED_MATH macro to be more general. Bug: angleproject:2713 Change-Id: I349947d320907839ca88ec1f9251e6ddc3858a08 Reviewed-on: https://chromium-review.googlesource.com/1128920 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Rafael Cintron 05a449a7 2018-06-20T18:08:04 Replace reinterpret_cast with safer or no cast When casting types to one another in C++, the weaker the cast, the better. This change replaces instances of reinterpret_cast with static_cast or no cast where it safe and correct to do so. BUG=angleproject:2683 Change-Id: I99c9033614a65282ae1d78cf0f4b80fabd75877a Reviewed-on: https://chromium-review.googlesource.com/1109396 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiawei Shao a8802477 2018-05-28T11:17:47 ES31: Implement FramebufferTextureEXT on OpenGL back-ends This patch intends to implement FramebufferTextureEXT on OpenGL back-ends. 1. Support layered framebuffer attachments. 2. Add new framebuffer completeness rules on layered framebuffer attachments. 3. Support FRAMEBUFFER_ATTACHMENT_LAYERED_EXT as a valid <pname> parameter of GetFramebufferAttachmentParameteriv. Note that for an entire level of a cube map: 1. It has no TextureTarget because TEXTURE_CUBE is not a valid target for TexImage*D. 2. It corresponds to 6 ImageDescs (that represents its faces) in class Texture, so when the cube map is cube complete, we return the ImageDesc of its first face, meanwhile we do not allow querying ImageDesc if it is not cube complete. BUG=angleproject:1941 TEST=angle_end2end_tests dEQP-GLES31.functional.geometry_shading.query.framebuffer_attachment_layers dEQP-GLES31.functional.geometry_shading.query.framebuffer_incomplete_layer_targets dEQP-GLES31.functional.geometry_shading.layered.* dEQP-GLES31.functional.geometry_shading.instanced.invocation_per_layer_* dEQP-GLES31.functional.geometry_shading.instanced.multiple_layers_per_invocation_* Change-Id: I44393b513ec8f1a682fd1c47d3eaa6f3b3fae877 Reviewed-on: https://chromium-review.googlesource.com/1075811 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jiawei Shao b1e91380 2018-05-17T14:33:55 ES31: Implement EXT_geometry_shader framebuffer default layers on OpenGL This patch implements FRAMEBUFFER_DEFAULT_LAYERS_EXT as a legal framebuffer parameter required in OpenGL ES 3.1 extension EXT_geometry_shader on OpenGL back-ends. The query on FRAMEBUFFER_DEFAULT_LAYERS_EXT specifies the layer count used when the framebuffer has no attachments. BUG=angleproject:1941 TEST=dEQP-GLES31.functional.geometry_shading.query.framebuffer_default_layers Change-Id: I888465dfe23da53541ec2fedb8616027df532466 Reviewed-on: https://chromium-review.googlesource.com/1063560 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Jeff Gilbert 31d3deb4 2018-05-18T18:32:16 Add `formatType` arg to computeSkipBytes. Fix texture upload format tests: - Format tests should definitely run on ES3 also. - Also set filters to NEAREST since some formats aren't filterable. - Fix RGB9_E5 test reference encoding and add a test for it. - True int/uint textures require i/usamplers. Bug: angleproject:2576 Change-Id: Ia5bac34cdee6554a88db339de443689a71a0cf70 Reviewed-on: https://chromium-review.googlesource.com/1068142 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 6110763f 2018-05-09T11:32:46 Refactor the GL surfaces and framebuffers to not hold renderer objects. BUG=angleproject:2464 Change-Id: I20aabeef3de6cf1fc13a29b6220e040aa83184d7 Reviewed-on: https://chromium-review.googlesource.com/1039986 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Geoff Lang 13455079 2018-05-09T11:24:43 Pass a context pointer to Framebuffer[Impl]::getSamplePosition BUG=angleproject:2464 Change-Id: Icd260db9bbd11699b2d0f6152e898c38baa4844d Reviewed-on: https://chromium-review.googlesource.com/1052219 Reviewed-by: Jamie Madill <jmadill@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>
Jamie Madill 19fa1c6f 2018-03-08T09:47:21 Return an Error from Framebuffer::syncState. This pipes errors up from the Impl to the top level. There are still a few places were error swallowing is needed, because the Framebuffer API doesn't support returning an error. Bug: angleproject:2372 Change-Id: Idc06bda1817fd28075940f69874d8b6ba69194f9 Reviewed-on: https://chromium-review.googlesource.com/954290 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Luc Ferron <lucferron@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>
Geoff Lang b52fac03 2018-02-21T15:45:35 Refactor ImageIndex to have separate type and target members. BUG=angleproject:2169 Change-Id: Ib3fb699058f76d0eb810a9691ea1d64311dadbb1 Reviewed-on: https://chromium-review.googlesource.com/929650 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 809b13ed 2017-11-07T15:33:46 StateManagerGL: Use dirty bits for framebuffer bindings. BUG=angleproject:2188 Change-Id: Icbe78f645b693a5b2ef555feffda0f618209e867 Reviewed-on: https://chromium-review.googlesource.com/757092 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Geoff Lang 92019431 2017-11-20T13:09:34 Make conversion from GL types to native bools consistant. Some places would compare with "== GL_TRUE" and others with "!= GL_FALSE". This behaviour is not in the OpenGL spec but "!= GL_FALSE" is the most standard and follows the same rules as C and C++. Remove un-necessary validation that params are either GL_TRUE or GL_FALSE. Update some internal storage from GLboolean to bool. BUG=angleproject:2258 Change-Id: I12adbe2d24318a206521ca6ad1099ee7e2bf677e Reviewed-on: https://chromium-review.googlesource.com/779799 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: 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 29ddcc99 2017-10-21T16:10:02 Add an auto-generated dispatch table for GL bindings. This will more easily allow us to extend our implementation to make a NULL or "stub" set of bindings. It also exposes a lot more function permutations via extension variations. It might improve the loading speed for bindings obtained via extensions. Instead of generating a list every time an extension is checked, we use a single std::set for a fast query. However because more extensions are checked for more entry points, it might not make a huge difference. This also fixes an issue where the "real" ANGLE GL headers were being propagated to the entry point dispatch table definitions, instead of being in a totally isolated file. This patch adds the missing typedefs to our proxy headers. It also fixes the naming of a few entry points which was inconsistent with the spec. It also makes an XML adjustment to GL_NV_path_rendering to accomodate a hole in the spec where glLoadMatrixfEXT was not ever defined in OpenGL ES. A spec oddity with the TexStorage extension is not resolved - in this case, some methods are only exposed if other extensions are present, but this information is missing from gl.xml. BUG=angleproject:2188 Change-Id: I0fd61dd32de6fadd55fa6bd79295833392d51104 Reviewed-on: https://chromium-review.googlesource.com/726949 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Kenneth Russell ce8602ab 2017-10-03T18:23:08 WebGL requires GL_FRAMEBUFFER_UNSUPPORTED for identical FBO attachments. If the same level of a texture is attached to multiple color attachments of a framebuffer object, for example, the WebGL conformance tests require generating a GL_FRAMEBUFFER_UNSUPPORTED error. The Direct3D backend already had this restriction; apply it to all backends when the WebGL compatibility extension is enabled. Fixes the following WebGL conformance tests with the pass-through command decoder in Chrome: conformance/extensions/webgl-draw-buffers-framebuffer-unsupported conformance2/rendering/framebuffer-unsupported BUG=angleproject:2168 Change-Id: I340d06ca0ee969989c6c5725512b1b9542281477 Reviewed-on: https://chromium-review.googlesource.com/699856 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang c71ea661 2017-09-26T17:06:02 Return HALF_FLOAT as an implementation read type in ES3. BUG=765953 Change-Id: I4dc79921766975cd75c489887b7e57ec4666fbbb Reviewed-on: https://chromium-review.googlesource.com/685897 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill d4826159 2017-09-21T11:18:59 Vulkan: Only init RenderPass once per frame. This saves some time spent in the driver, by making multiple draw calls happen inside a single RenderPass. This also makes the ReadPixels impl method non-const. I think in the future we should avoid making const Impl methods unless they're totally trivial. BUG=angleproject:1898 Change-Id: I39172270a2f7dc5c1c2e3d4cc50af3bac8a29fa1 Reviewed-on: https://chromium-review.googlesource.com/672148 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Martin Radev 61e710b6 2017-09-05T11:59:52 GL: Optimize multi-view layered Clear* commands Until this patch multi-view layered framebuffers used to be cleared by attaching a single layer of each attachment to a framebuffer and calling the Clear* command for that internal framebuffer. According to the GL 4.1+ specifications, Clear* commands clear all of the layers of an attached 2D texture array. If all of the layers are active for a multi-view layered framebuffer, then we can directly call the corresponding Clear* command instead of iterating over each layer and clearing it. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Ie4dfd9fff47715b502f358272bfc47c0373c4e91 Reviewed-on: https://chromium-review.googlesource.com/649209 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Martin Radev 7c2e6a96 2017-08-28T11:13:16 Do not forward multi-view fields to backend on detach The patch fixes an unexposed bug in FramebufferGL which would pass an incorrect multi-view state to StateManagerGL on texture detachment. The bug is not exposed because upon a subsequent syncing step the correct state is queried and restored from the framebuffer state. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Ie0e783c53e87497b3673ef87ab9c53c3c04054a7 Reviewed-on: https://chromium-review.googlesource.com/636369 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Martin Radev 5e424fae 2017-08-09T16:25:36 Handle Clear* commands for layered framebuffers The patch adds support for clearing the layers of 2D array textures attached to a multi-view framebuffer. According to the ANGLE_multiview spec, the layers which are outside of the range [baseViewIndex; baseViewIndex + numViews) should remain unmodified. Because the native Clear* commands clear all of the layers, a workaround is implemented which creates a FBO, attaches a single layer from all multi-view attachments and clears the contents. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Ibf711d02046233eed16bdd3f9c96fc38f82ed0a8 Reviewed-on: https://chromium-review.googlesource.com/615242 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Martin Radev 4e619f58 2017-08-09T11:50:06 Add branch for viewport or layer selection in VS The patch extends the behavior of SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER so that either the viewport or layer is selected based on the value of the internal uniform variable MultiviewRenderPath. BUG=angleproject:2062 TEST=angle_end2end_tests TEST=angle_unittests Change-Id: Ia311b12b1fed642dac78eba8732e2535242f34fd Reviewed-on: https://chromium-review.googlesource.com/615260 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Martin Radev eef80e40 2017-08-11T14:44:57 Do not implicitly enable the scissor test for side-by-side FBOs The patch modifies the ANGLE_multiview specification so that issuing a Draw* command has undefined results for side-by-side FBOs if the scissor test is disabled. Also, clearing a side-by-side framebuffer will result in clearing the whole content of the specified buffers if the scissor test is disabled. StateManagerGL and FramebufferGL are modified to address this change in the spec. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I39a87d297944f12769dee2ead17b508ac22053db Reviewed-on: https://chromium-review.googlesource.com/612283 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 13c0dd46 2017-07-04T18:27:01 Add texture rectangle extension. This is needed to support binding IOSurfaces to textures on OSX. This commit adds support in the API and tests, but didn't need to implement compiler changes as it already supported ARB_texture_rectangle. Implementation of CHROMIUM_opy_texture for rectangle texture and the spec are left for follow-up commits. Change-Id: I45c66be763a9d3f6f619640f9f95f39b05c70867 Reviewed-on: https://chromium-review.googlesource.com/559106 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Martin Radev b0761934 2017-07-25T17:42:25 Handle Clear* commands for side-by-side framebuffers Clear* commands for side-by-side framebuffers require special handling because only the scissor rectangle of the first viewport is used in the scissor test as defined in the OpenGL 4.1+ specs. To enable clearing of each view of a side-by-side framebuffer all views are iterated over, the corresponding scissor rectangle is set as first, and a Clear* call is made to the driver. Afterwards the scissor state is restored. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I138663ea61b4f0c9302872108e7dfbadf451b3ec Reviewed-on: https://chromium-review.googlesource.com/590233 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Martin Radev 878c8b1e 2017-07-28T09:51:04 Handle viewport and scissor state changes for side-by-side framebuffers Side-by-side framebuffers have viewport offsets as part of their state which have to be applied to the viewport and scissor rectangles to generate the final viewport and scissor rectangles of each view. Whenever there is a transition to or from a side-by-side framebuffer, viewport and scissor state has to be synced. Also, because rendering is done on the same 2D texture the scissor test has to be always enabled to guarantee that no fragments leak to a neighboring view. The patch addresses this by extending the viewport and scissor state in StateManagerGL to be a vector of rectangles instead of a single rectangle. Two new dirty bits are added to cover changes in the viewport offsets and whether the framebuffer has a side-by-side layout. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I8107d7ba97d06b20cf24358f19963fa494844592 Reviewed-on: https://chromium-review.googlesource.com/585012 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Frank Henigman fa36c330 2017-06-09T18:44:45 Clip FramebufferGL::readPixels to framebuffer. In GL, ReadPixels() is allowed to modify memory that corresponds to pixels outside the framebuffer. In WebGL it must not do that, so clip the read area to the framebuffer. Enable corresponding test. BUG=angleproject:1815 Change-Id: I8113ae417dee7834e63498aec8291ce711bd7513 Reviewed-on: https://chromium-review.googlesource.com/536434 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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>
Corentin Wallez e7557744 2017-06-01T13:09:57 WebGL compatibility: remove UB for draw buffers in the GL backend. WebGL adds two rules: - Fragment outputs declared but not written to should default to black. - FBO attachments for outputs not declared in the shader should not be written to (it is UB in OpenGL ES). Fix the first one by using the SH_INIT_OUTPUT_VARIABLES compiler options, and the second one by messing with glDrawBuffers so that the enabled draw buffers are always a subset of the ones declared by the shader. BUG=angleproject:2048 Change-Id: I1d851c190959c1acfc3e41d837e6990aec1d4086 Reviewed-on: https://chromium-review.googlesource.com/521682 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c564c070 2017-06-01T12:45:42 Pass gl::Context to impl methods instead of ContextImpl. In some cases we might have to call back into the GL layer, passing the Context, and if we just have a ContextImpl pointer this isn't possible. It also removes the need for SafeGetImpl. BUG=angleproject:2044 Change-Id: I6363e84b25648c992c25779d4c43f795aa2866d6 Reviewed-on: https://chromium-review.googlesource.com/516835 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 231c7f56 2017-04-26T13:45:37 Apply clang-format to many files. This cleans up the formatting in many places. BUG=None Change-Id: I6c6652ebc042f1f0ffecced53582d09d66b4f384 Reviewed-on: https://chromium-review.googlesource.com/487884 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 876429b7 2017-04-20T15:46:24 Update gl2.h and update entry points. Some method signatures were updated. Types like GLclampf and GLvoid were replaced with other equivalents. BUG=angleproject:1309 Change-Id: I05e8e2072c5a063d87ad96a855b907424661e680 Reviewed-on: https://chromium-review.googlesource.com/475011 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Jamie Madill 6de51858 2017-04-12T09:53:01 Optimize angle::BitSetIterator. Adds a new custom bitset template to handle packing as many bits as possible into a single variable. Intelligently select the right class depending on platform features and bit sizes. For now, always use a packed 64-bit set on 64-bit, instead of using a 32-bit set for smaller bitsets. BUG=angleproject:1814 Change-Id: I3ffef815c15515555833f6fc9302d8a4eee5423b Reviewed-on: https://chromium-review.googlesource.com/471827 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 20e005b2 2017-04-07T14:19:22 Rename BitSetIterator.h to bitset_utils.h BUG=angleproject:1814 Change-Id: I152ae13b6b7cf0ba72259967f0f124e199b20e07 Reviewed-on: https://chromium-review.googlesource.com/471826 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dd43e6cd 2017-03-24T14:18:49 Pass Context to VertexArray and Framebuffer syncstate. This will enable more Vulkan-friendly idioms like clearing the vulkan pipeline caches correctly on GL state changes immediately because we have access to the ContextVk. BUG=angleproject:1898 Change-Id: I16c848d8abdde8e26a38d384e565cec8548a66d0 Reviewed-on: https://chromium-review.googlesource.com/459079 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 005a7016 2017-03-27T13:17:34 Adjust the FBO invalidate attachment enums for emulated default FBOs. BUG=angleproject:1953 Change-Id: I7f325e3b7400e12077cdf9106a83a747a318a299 Reviewed-on: https://chromium-review.googlesource.com/461297 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Frank Henigman 308d745d 2017-02-15T22:51:21 Don't use GL_FRAMEBUFFER_SRGB unless available. Don't try to enable or disable GL_FRAMEBUFFER_SRGB unless extensions.sRGBWriteControl is true. For example if you try it with Mesa GLES2 you get a GL error. BUG=angleproject:1896 Change-Id: I5f5b4e8ea4f5a7c6913f27761a6e2dc88aacc78c Reviewed-on: https://chromium-review.googlesource.com/443824 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
JiangYizhou f7bbc8a3 2016-11-16T09:57:22 ES3.1: Implement framebuffer parameters api for opengl part. Add new framebuffer parameters that can be set with glFramebufferParameteri and queried with glGetFramebufferParameteriv. GL_FRAMEBUFFER DEFAULT WIDTH GL_FRAMEBUFFER_DEFAULT_HEIGHT GL_FRAMEBUFFER_DEFAULT_SAMPLES GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS BUG=angleproject:1594 TEST=angle_unittests TEST=angle_end2end_tests TEST=dEQP-GLES31.functional.state_query.framebuffer_default.framebuffer_default* Change-Id: I425e73a6b798fc7c73841ab98d7c8aabc381133d Reviewed-on: https://chromium-review.googlesource.com/412126 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Yuly Novikov bcb3f9ba 2017-01-27T22:45:18 Direct logging to Platform when available All logging should be done via ERR() and WARN(), which call angle::Platform's logError and logWarning, if there is current Platform which supports logging. Otherwise, ERR() is directed to std::cerr. Misc fixes to keep tests passing. BUG=angleproject:1660, angleproject:1644 Change-Id: I2bca33a021537185d0c236a3083789af3236b5f3 Reviewed-on: https://chromium-review.googlesource.com/434188 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
JiangYizhou bddc46b4 2016-12-09T09:50:51 ES31: Implement multisampled Textures. Implement TexStorage2DMultisample and getMultisamplefv entry point. Also modify sample state for Textures and Framebuffers. BUG=angleproject:1590 TEST=angle_unittests TEST=angle_end2end_tests TEST=dEQP-GLES31.functional.texture.multisample.samples_*.sample_position TEST=dEQP-GLES31.functional.texture.multisample.samples_*.use_texture_color_2d TEST=dEQP-GLES31.functional.texture.multisample.samples_*.use_texture_depth_2d TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_different_sample_count_tex_tex TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_different_sample_count_tex_rbo TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_non_zero_level TEST=dEQP-GLES31.functional.texture.multisample.negative.texture_high_sample_count TEST=dEQP-GLES31.functional.texture.multisample.negative.texture_zero_sample_count TEST=dEQP-GLES31.functional.shaders.builtin_functions.texture_size.samples_1_texture_2d TEST=dEQP-GLES31.functional.shaders.builtin_functions.texture_size.samples_4_texture_2d Change-Id: I8fa7bd4e73b95745858a3e16b1b92004b4a18712 Reviewed-on: https://chromium-review.googlesource.com/414309 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yunchao He <yunchao.he@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
He Yunchao acd1898e 2017-01-04T10:46:42 Replace Error(GL_NO_ERROR) with NoError(). In order to make the errors be consistent throughout ANGLE. BUG=angleproject:1686 Change-Id: I0a2d86091d640aedeac94beae345c1fb6971b00d Reviewed-on: https://chromium-review.googlesource.com/424835 Commit-Queue: Yunchao He <yunchao.he@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 4596a769 2016-12-20T14:50:18 FramebufferGL: fix a crash when there is no color buffer. BUG=chromium:675819 Change-Id: I7d143ba51bb16f28b145aa2b0410929d29e0b464 Reviewed-on: https://chromium-review.googlesource.com/422493 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 57ce9ea2 2016-11-24T12:03:14 Implement EXT_discard_framebuffer for the GL backend. BUG=angleproject:1634 Change-Id: I3822b99b59d4653e4d9a2c1d3dd16734f2050fae Reviewed-on: https://chromium-review.googlesource.com/414437 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 6898b358 2016-11-10T11:41:15 FramebufferGL: Fix blit workaround corner case The SRGB blit workaround had to wrong assumptions: - SRGB blits can have a multisample source. - The woarkound is needed even when the filter is GL_LINEAR in the case where we are doing a RGB -> SRGB or RGB -> SRGB blit. BUG=angleproject:1492 BUG=chromium:658898 Change-Id: I1d89572565a4e23c1c97bdf985bb21a445e898b7 Reviewed-on: https://chromium-review.googlesource.com/409540 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 1d2c41d6 2016-10-19T16:14:46 Implement GL_EXT_sRGB_write_control for GL. BUG=angleproject:1547 BUG=655247 Change-Id: I3f04ddc7032e4a47eb21ff3b8586c5b47415bb64 Reviewed-on: https://chromium-review.googlesource.com/400958 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez f7417801 2016-10-12T17:59:31 FramebufferGL: only work around SRGB blits on Desktop GL BUG=angleproject:1492 Change-Id: I6c210243dffb775efd61c33160dabcbf7406a757 Reviewed-on: https://chromium-review.googlesource.com/397798 Reviewed-by: Yuly Novikov <ynovikov@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 886de369 2016-09-27T10:49:35 Factor code between PixelUnpackState and PixelPackState BUG=angleproject:1512 Change-Id: I4c60472d216bfc5198e635d70fd197a5738dde98 Reviewed-on: https://chromium-review.googlesource.com/390133 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 9a8d366a 2016-09-22T12:18:29 FramebufferGL: add readPixels workarounds Implements workarounds for: - The pack state making rows overlap in memory, which causes crashes on some drivers. - The driver adding an extra last row padding when checking if the pixel pack buffer is large enough for the readPixels. BUG=angleproject:1512 Change-Id: I120ff58649bb523e8b01da6ef03d8fcadaf076b2 Reviewed-on: https://chromium-review.googlesource.com/388029 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang f607c60a 2016-09-21T11:46:48 Fix validation of ReadPixels format and type. The validation for ReadPixels allows for two combations of format/type: 1. Based on the current framebuffer's component type. * GL_RGBA/GL_UNSIGNED_BYTE if the framebuffer is a normalized (signed or unsigned). * GL_RGBA_INTEGER/GL_INTEGER if the framebuffer is an integer format. * GL_RGBA_INTEGER/GL_UNSIGNED_INTEGER if the framebuffer is an unsigned integer format. * GL_RGBA/GL_FLOAT if the framebuffer is any type of float framebuffer (added in EXT_color_buffer_float). * These combations are detailed in the ES2 spec on pg 105 or ES3 on pg 193. 2. The implementation read format/type returned from glGetIntegerv. * These formats are added by specs, OES_texture_float, EXT_texture_rg, EXT_read_format_bgra, etc. Update the GL and D3D backends to perform the conversion from GL_HALF_FLOAT to GL_HALF_FLOAT_OES. Continue allowing reading as BGRA_EXT to support Skia. Should be removed in the future. BUG=607283 BUG=angleproject:1478 Change-Id: I0312cad4d5f138ab036f383d221f8ccd19a77f6d Reviewed-on: https://chromium-review.googlesource.com/346232 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill a3944d4f 2016-07-22T22:13:26 Add gl::Format to represent a texture/rb/surface format. This has a few advantages: it preserves all the information of the internal format, such as if it is sized or unsized. It also saves looking up the format multiple times in the table, which should improve speed in some cases. The extra sized-ness information will allow us to perform the correct validation in CopyTexSubImage calls. BUG=angleproject:1228 Change-Id: I42954771b0a9a968f5d787b8cf6e0af721791855 Reviewed-on: https://chromium-review.googlesource.com/362626 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dfde6abf 2016-06-09T07:07:18 Context: Remove mutable gl::State getter. This will preserve layering - the API layer doesn't mutate the state directly, it passes the API call through to the Context. Is also removes the possiblity of any shenanigans of the Validation layer changing the GL state. Also, this CL refactors a few validation entry points to take ValidationContext instead of Context. ValidationContext will be the correct way to interact with the gl::Context in the Validation code. Finally, additional refactorings make ContextState a proper class with private data. This allows the ContextState itself to keep a mutable pointer to the gl::State, so ValidationContext can modify it if necessary (and it will be necessary for Framebuffer completeness caching). BUG=angleproject:1388 Change-Id: I86ab3561573caa9535c8d1b8aad4ab3d0e7cd470 Reviewed-on: https://chromium-review.googlesource.com/348954 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8415b5fd 2016-04-26T13:41:39 Pass ContextImpl to Framebuffer methods instead of ContextState. BUG=angleproject:1363 Change-Id: I7e7524d95f2ca31c35918f9fe5c0cb681ed93616 Reviewed-on: https://chromium-review.googlesource.com/340746 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 48ef11b2 2016-04-27T15:21:52 Rename gl::Framebuffer::Data to gl::FramebufferState. Moving this out of the Framebuffer class allows us to forward- declare it. BUG=angleproject:1363 Change-Id: I91971c37a92151df508cdf7f0eb8c3e93506d112 Reviewed-on: https://chromium-review.googlesource.com/340741 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9082b982 2016-04-27T15:21:51 Rename gl::Data to gl::ContextState. Part of the new world order of renaming the Obj::Data classes to ObjState. BUG=angleproject:1363 Change-Id: I15cf002b8b093d687f540b9e86f045874af24a7e Reviewed-on: https://chromium-review.googlesource.com/340740 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman a3d333c2 2016-03-22T22:09:14 Don't enable/disable sRGB on GLES. glEnable/glDisable GL_FRAMEBUFFER_SRGB isn't meaningful on GLES. BUG=angleproject:1300 Change-Id: I0afd697ed9770e2eb1cdcc851884b90de1a4583c Reviewed-on: https://chromium-review.googlesource.com/334490 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 60ec6ea7 2016-01-22T15:27:19 Implement dirty bits for Framebuffer. The dirty bits set the stage for performance improvements in D3D, but don't actually reduce any of the redundant work just yet. BUG=angleproject:1260 Change-Id: Ib84e6a9b7aa40c37c41790f492361b22faaf4742 Reviewed-on: https://chromium-review.googlesource.com/318730 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Dian Xiang 4028159e 2015-11-19T18:24:44 Using dirty bit notification for D3D11 viewport state BUG=angleproject:1161 This is a continuation of the dirty bit refactor Change-Id: I101f415094dd406f6b0a40cb260f1cbbfec7b62c Reviewed-on: https://chromium-review.googlesource.com/313249 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tryjob-Request: Dian Xiang <dianx@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Dian Xiang <dianx@google.com>
Jamie Madill 2da819e1 2015-12-03T15:53:19 D3D11: Fix blit from out-of-bounds. Do not copy pixels in a negative read region. Also make sure we clamp the boundaries so the dEQP tests are mostly pixel-perfect. We can't yet fix some default framebuffer tests because of issues with blitting RGBA8 (default FBO) to floating point framebuffers. BUG=angleproject:1241 TEST=dEQP-GLES3.functional.fbo.blit.* Change-Id: I16ee264b0b1a7e6b9121dde5ae4f96cfd27ea53e Reviewed-on: https://chromium-review.googlesource.com/315670 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill cc86d64e 2015-11-24T13:00:07 Make Framebuffer size check ES2-only. This is an ES2-only incompleteness check. We also need to require matching dimensions in D3D11, but make this an implementation specific check. Also make all implementation specific errors 'UNSUPPORTED' since that catches all "non-ES" framebuffer restrictions. Note that we can't be conformant here in D3D11 currently, since the spec only makes an exception for mismatching formats for UNSUPPORTED, not for size checks. However, we don't have an easy solution. BUG=angleproject:1225 Change-Id: Ic80a04bce397fc12643b010c874f432033babc5d Reviewed-on: https://chromium-review.googlesource.com/313990 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang afd7f0a8 2015-09-09T15:33:31 Explicitly enable framebuffer SRGB blending in StateManagerGL. In DesktopGL, SRGB blending must be enabled or linear blending will be used. reland: Work around issues on AMD drivers where SRGB blending would be used on clears of linear attachments. Passes all dEQP-GLES3.functional.fragment_ops.blend.fbo_srgb.* tests (1106 new passing tests). BUG=angleproject:883 BUG=angleproject:885 Change-Id: I974a55fe3acc77ac77e93f19c83ee3b76f784df2 Reviewed-on: https://chromium-review.googlesource.com/302336 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 543e7ff7 2015-09-29T14:15:15 Revert "Explicitly enable framebuffer SRGB blending in StateManagerGL." More compile errors on mac. This reverts commit 056fae4a01db306b8f9c1e57374e18ebffbdf8eb. Change-Id: I579b9e50ded7240be4f488a48588a89ecb4bea44 Reviewed-on: https://chromium-review.googlesource.com/302571 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 056fae4a 2015-09-09T15:33:31 Explicitly enable framebuffer SRGB blending in StateManagerGL. In DesktopGL, SRGB blending must be enabled or linear blending will be used. reland: Work around issues on AMD drivers where SRGB blending would be used on clears of linear attachments. Passes all dEQP-GLES3.functional.fragment_ops.blend.fbo_srgb.* tests (1106 new passing tests). BUG=angleproject:883 BUG=angleproject:885 Change-Id: I6c2b4552c571707a8d8d80d3573bcb38797c3929 Reviewed-on: https://chromium-review.googlesource.com/302791 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang ec3123bb 2015-09-28T19:21:01 Revert "Explicitly enable framebuffer SRGB blending in StateManagerGL." Compilation failure on mac and linux. This reverts commit e19d7f90355f02ac7a7cd0a2ac130e0859cd3cc7. Change-Id: I638c3ffebb8c7ad0e3fe2e1e65d6212487bfc6ae Reviewed-on: https://chromium-review.googlesource.com/302790 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang e19d7f90 2015-09-09T15:33:31 Explicitly enable framebuffer SRGB blending in StateManagerGL. In DesktopGL, SRGB blending must be enabled or linear blending will be used. reland: Work around issues on AMD drivers where SRGB blending would be used on clears of linear attachments. Passes all dEQP-GLES3.functional.fragment_ops.blend.fbo_srgb.* tests (1106 new passing tests). BUG=angleproject:883 BUG=angleproject:885 Change-Id: I03fbb0910ce414552ba841099a177446d0ace7b6 Reviewed-on: https://chromium-review.googlesource.com/301702 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 260efc21 2015-09-23T16:45:54 Revert "Explicitly enable framebuffer SRGB blending in StateManagerGL." Causing failures on AMD OpenGL drivers for sRGB clears. This reverts commit 04b89c975b3c7f6b86191d0255136a8a798f0b66. Change-Id: I51ee856d1c4d37882e5b1d1926415c398fa7ff5c Reviewed-on: https://chromium-review.googlesource.com/301721 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 04b89c97 2015-09-09T15:33:31 Explicitly enable framebuffer SRGB blending in StateManagerGL. In DesktopGL, SRGB blending must be enabled or linear blending will be used. Passes all dEQP-GLES3.functional.fragment_ops.blend.fbo_srgb.* tests (1106 new passing tests). BUG=angleproject:883 BUG=angleproject:885 Change-Id: I0dfb744faa811f10be47c5bd8295b368baf3b04b Reviewed-on: https://chromium-review.googlesource.com/298620 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 86f8dd7c 2015-08-12T12:37:48 Implement a minimal EGL -> CGL backend This succesfully renders HelloTriangle and some samples but fails on a lot of tests. In particular it doesn't handle resizing the window and doesn't have depth or stencil buffers. BUG=angleproject:891 Change-Id: I16356471b470f764acb38e8dd3589e9c0129829d Reviewed-on: https://chromium-review.googlesource.com/290770 Tested-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang da34d002 2015-09-04T11:08:59 Apply the pixel pack state before ReadPixels in FramebufferGL. This ensures that the PBO is bound because it does not have a dirty bit yet. BUG=angleproject:1149 BUG=angleproject:885 Change-Id: Iad96abc4dec4e6ac8187975c7638dfd7f18951e7 Reviewed-on: https://chromium-review.googlesource.com/296963 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Cooper Partin 4d61f7ed 2015-08-12T10:56:50 Reland Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' Additional warnings found with more testing and added C4267 warning disable only for angle_libpng BUG=angleproject:1120 Change-Id: Ic403dcff5a8018056fa51a8c408e64207f3362eb Reviewed-on: https://chromium-review.googlesource.com/293028 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b195643c 2015-08-12T17:35:20 Revert "Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'" Seems to have quite a few warnings in 64-bit on my machine. BUG=angleproject:1120 This reverts commit c5cf9bc47d0ee028adbbf9e9f94ca567eec601dc. Change-Id: I86768b900aeba52e7a2242d9ae8949f93f1a5ba9 Reviewed-on: https://chromium-review.googlesource.com/293280 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin c5cf9bc4 2015-08-06T10:46:48 Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' BUG=angleproject:1120 Change-Id: I01ef10bea7f487c2b394d030c76628f38d2ea645 Reviewed-on: https://chromium-review.googlesource.com/292780 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1b94d432 2015-08-07T13:23:23 Implement dirty bits for RendererGL's basic state. BUG=angleproject:1040 TEST=angle_end2end_tests,angle_perftests,WebGL Change-Id: I72beaf7e178e042440337fbb8b9669638c5ad016 Reviewed-on: https://chromium-review.googlesource.com/289558 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 6ab01b9a 2015-08-03T10:16:36 FramebufferGL: Add a member to know if we are the default FBO On CGL, the default framebuffer will have a name different than 0 and without this change it wouldn't get special-cased as on the other platforms. It is assumed that the default framebuffer will get initialized directly by the driver or other parts of the code. BUG=angleproject:891 Change-Id: Ifbe4ada58f27ad9ddb5b43697c234cb17e7504f0 Reviewed-on: https://chromium-review.googlesource.com/290147 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>