src/libANGLE/Surface.cpp


Log

Author Commit Date CI Message
Jeff Vigil d2b659f9 2021-03-25T15:40:58 EGL: implement EGL_EXT_protected_content Context Add Validation check to Contexts and Surfaces Add Vulkan protected memory features and properties Add protected member to Surfaces and Contexts Implement hasProtectedContent in Vulkan Add QueueFamily helper, extent DeviceQueueMap Protected Swapchains always on for Android Add EGLProtectedContentTest Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: I9352b1e594f71bb4e89cee7137a468940d186b1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2800413 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8c1cbc5a 2021-07-16T14:01:53 Implement EGL_KHR_mutable_render_buffer in the front-end. Note that we do not currently expose any mutable configs. Bug: b/192352791 Change-Id: Ib97f7889fedd91d09ef32dc7e7494ea4476cd7bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3035583 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Gert Wollny b6009f64 2021-06-17T14:53:03 Capture/Replay: Add feature for robust resource init Query the feature when creating the display and the context, and pass the flag to the created context and also to durfaces. With that we create surfaces that will be marked "MayNeedInit" and are initialized if the resource is cleared or invalidated. Bug: angleproject:6041 Change-Id: I292f2e3f931736a18db93695441407e17d2265b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2976656 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jeff Vigil 22fc9523 2021-02-03T15:32:48 EGL: implement EGL_EXT_buffer_age Add extension flag. Add Validation check to surface query. Enable extension for vulkan. Modify AcquireNextImage to ++frame count and tag images with frame number. Buffer age is the difference between current frame count and the tagged frame number on the buffer. getBuffeAge may need to trigger AcquireNextImage to be current. Pass through egl extension and query. Add EGLBufferAgeTest Test: angle_end2end_test --gtest_filter=EGLBufferAgeTest Test: angle_deqp_egl_tests --deqp-case=dEQP-EGL.functional.buffer_age.* Bug: angleproject:3529 Change-Id: I0cb94be1c3e85d6f33e82a6a1ccdc9731b6a7f23 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2684724 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 937bc82b 2020-12-17T17:57:50 Revert "GLX: Expose EGL_ANGLE_window_fixed_size" This reverts commit fa9b803e078fb833143df7a2b3f88c8694fa8f2f. Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1157748 Original change's description: > GLX: Expose EGL_ANGLE_window_fixed_size > > Right now the GLX backend checks for resize on every SwapBuffers > call. If EGL_ANGLE_window_fixed_size is used, it will only resize > when signaled by Chrome. > > Bug: chromium:1132827 > Change-Id: Ia4ddbbbf6dcf13f46ad564208eccc517de8be33c > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2572886 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> TBR=syoussefi@chromium.org,jonahr@google.com,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: chromium:1132827 Change-Id: I1110c5dd5d806b3c6c59308d4865f0d3aa57fc3f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2595197 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Xiaoxuan Liu 108b759e 2020-12-04T15:15:49 EGL: Update EGL headers/xml The new EGL headers introduced 'EGL_NO_X11' which we could use for ANGLE vulkan display/headless backend. Changes in CL: 1. Updated include/EGL/egl*.h and scripts/egl.xml based on latest EGL repo: https://github.com/KhronosGroup/EGL-Registry Note: local modifications to the file were preserved in eglext.h, search keyword 'eglext_angle.h' for detail 2. run scripts to update entry_points/loader scripts/generate_entry_points.py scripts/generate_loader.py scripts/run_code_generation.py 3. Update ANGLE code on API 'eglSwapBuffersWithDamage' 4. Format with 'git cl format' Bug: angleproject:5260 Change-Id: I70ed0dccecf0426929ef8b4775605554d66c5724 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2576314 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jonah Ryan-Davis fa9b803e 2020-12-03T17:53:12 GLX: Expose EGL_ANGLE_window_fixed_size Right now the GLX backend checks for resize on every SwapBuffers call. If EGL_ANGLE_window_fixed_size is used, it will only resize when signaled by Chrome. Bug: chromium:1132827 Change-Id: Ia4ddbbbf6dcf13f46ad564208eccc517de8be33c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2572886 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Paul Thomson db679caf 2020-11-25T21:08:46 Capture/Replay: track swapWithDamage Frames were captured in Surface::swap, but not in Surface::swapWithDamage. Adds the same callback in Surface::swapWithDamage and Surface::swapWithFrameToken. Bug: b/174256233 Change-Id: I3425fa2b9ae388f62f616dd2c9444797358ba148 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2560726 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang feafc888 2020-11-24T14:06:09 GL: Treat RGBA+HALF_FLOAT IOSurfaces as sized formats. ANGLE_iosurface_client_buffer imports IOSufraces with GL_RGBA + GL_HALF_FLOAT which isn't a valid GLES internalFormat + type combination so sampling from this format fails. We cannot easily update the spec on this format because it is also implemented by SwiftShader so manually adjust the format to sized RGBA16F. Bug: chromium:1148599 Change-Id: I3f24bbdcd08003eaae26e8391e5edca7a51f6888 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2558950 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 5b419533 2020-11-03T13:33:44 GL: Implement EXT_YUV_target Add test coverage of YUV format sampling as RGB or directly as YUV and rendering as YUV using layout(yuv). Initializing YUV AHardwareBuffers requires Android API 29 so ANGLE must be compiled with: android32_ndk_api_level = 29 android64_ndk_api_level = 29 The following tests can still run with Android API 26 because they don't need to initialize the buffer: ImageTestES3.ClearYUVAHB ImageTestES3.YUVValidation Bug: angleproject:4852 Bug: b/172649538 Change-Id: I4fe9afb2a68fb827dc5a5732b213b5eb60d585ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2517562 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 97843bda 2020-10-30T17:03:36 Vulkan: Fix EGL Surface robust init. The error here was related to using a single cache variable for the robust init setting for all the surfaces in a DisplayVk. Fix this by passing down the robust init setting from the SurfaceVk to image init. Bug: angleproject:5274 Change-Id: I9bc9c20990268d1d5166411fb53f8f2593fd1971 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510694 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Ian Elliott 6eb7756d 2020-08-07T17:41:39 Vulkan: tell ContextVk when swapchain is re-created For an app that only draws to the swapchain, if the swapchain is recreated with a different rotation (as done by the ANGLE perf tests when switching from Angry Birds 2 to Candy Crush), ContextVk is not informed, and so the new rotation is ignored. Use the subject-observer pattern to set the appropriate dirty bits. Test: run_angle_perftests --gtest_filter=TracePerfTest.Run/vulkan_angry*:*vulkan_candy* --verbose --local-output Bug: angleproject:4910 Bug: b/163126746 Change-Id: Ib5303e9c4095db1b3e736911f483589e40a73d0c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2341768 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Manh Nguyen dce37b7d 2020-06-21T22:27:06 Serialize framebuffers + compare contexts for CaptureReplayTests Adds to frame capture the ability to serialize a frame's pre-swap GL state and store it in the binary data file Adds to CaptureReplayTests the ability to compare its serialized GL state with the serialized state pulled from the binary data file Adds a serialization module that serializes framebuffers' GL states and the contents of their color attachments Adds checks to automation script so that it would skips tests that do not produce the expected trace files Adds exception handling to automation script so that it will not crash when a replay build crashes Bug: angleproject:4779 Change-Id: I40a02e018073749e79f0ddbfd3d4065745548f46 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2258295 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Geoff Lang 4e6f6545 2020-04-16T16:31:24 GLX: Support X11 pixmaps Add support for creating EGL pixmaps from X11 pixmaps using GLX. Pixmaps are needed for various external APIs such as VAAPI. Add support for EGL_NOK_texture_from_pixmap to allow binding pixmaps to textures. BUG=angleproject:4560 Change-Id: I4a6d3ad7e87151ff5317bbdaaf093ac1b46daf5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2153805 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Sunny Sachanandani 4b225c70 2020-05-06T15:38:12 Add texture offset attributess for D3D texture pbuffer surfaces Add EGL_TEXTURE_OFFSET_X_ANGLE and EGL_TEXTURE_OFFSET_Y_ANGLE attributes to EGL_ANGLE_d3d_texture_client_buffer which are used to specify offsets used for rendering into the pbuffer surface backed by a D3D11 texture. Rendering with the correct offset is needed when Chrome gets a texture and offset from an external source e.g. when calling BeginDraw() on IDCompositionSurface. Bug: angleproject:2997 Change-Id: I363f739f3f05c38720f385e34c91e98fc6a622a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2186176 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Ian Elliott 718ae508 2020-04-28T08:42:07 Vulkan: Always query EGL_WIDTH and EGL_HEIGHT This fixes the failures of the dEQP EGL resize tests on Android. Those tests don't actually resize the window (which would allow the tests to pass), but do change internal Android Surface values that vkGetPhysicalDeviceSurfaceCapabilitiesKHR queries. Therefore, by freshly querying these values the test passes. Bug: b/153329980 Change-Id: Ie966f221bfaa14988c1503c7f5503f0b21476bcb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2165639 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Jamie Madill 1fc354fa 2020-04-22T11:49:00 Re-land: "Vulkan: Forward RenderBuffer/Surface dirty messages." Re-land fixes ASSERT on Android GLES. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I91d31213b115a58546b574caa574eebbb098266c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159294 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 623d0443 2020-04-21T15:15:03 Revert "Vulkan: Forward RenderBuffer/Surface dirty messages." This reverts commit 3fb33ade6ec8f286797bff5645304df580b1a963. Reason for revert: Causing WebGL test failures on GLES/ANGLE/Android. Bug: chromium:1072739 Original change's description: > Vulkan: Forward RenderBuffer/Surface dirty messages. > > Previously we were only forwarding Texture staging changes to the > Framebuffer for re-sync. We could miss out on clears that were staged > in Surfaces and Renderbuffer attachments. Complete the chain by making > the SurfaceVk and RenderbufferVk forward notifications from the > VkImage. > > Bug: angleproject:4517 > Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=cnorthrop@google.com,timvp@google.com,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:4517 Change-Id: I4fd4d79dc11da0ba86065d3a80975de4c791a2a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159288 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3fb33ade 2020-04-09T15:27:12 Vulkan: Forward RenderBuffer/Surface dirty messages. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 1a1a1427 2020-01-23T13:57:21 Expose eglGetMscRateCHROMIUM from EGL_CHROMIUM_sync_control When ANGLE is using the GL backend on GLX, we can expose eglGetMscRateCHROMIUM via glXGetMscRateOML. Otherwise, this function should return false. Bug: chromium:1042393 Change-Id: Id9b308c2217e07ee9860e2869be0e23b7a0c7411 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2017048 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mohan Maiya 942d9152 2019-12-23T15:31:52 EGL: Add support for EGL_KHR_gl_colorspace extension If the Vulkan backend supports VK_EXT_swapchain_colorspace extension, enable the option for applications to create surfaces with non-linear formats. Not all formats have non-linear versions and is platform specific. Tests: dEQP-EGL.functional.wide_color.* angle_deqp_egl_tests --use-angle=vulkan --deqp-gl-context-type=egl --deqp-case=dEQP-EGL.functional.wide_color.* Bug: angleproject:2514 Change-Id: I441ee797cceef92c84473bfa18605c4fd8180de1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1951963 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jonah Ryan-Davis a829c0b9 2019-11-14T16:49:02 Expose EGL_CHROMIUM_sync_control via GLX_OML_sync_control On GLX, we can expose the EGL_CHROMIUM_sync_control extension by forwarding to GLX_OML_sync_control when it's available. This will help with accurate vsync times for Chrome Bug: 1020252 Change-Id: I9b1e8cf0f8b1a548cc7cc7202fac2d0cdb01d74d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1918104 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill c898ec1a 2019-11-04T15:20:18 Add EGL GGP extensions. This CL adds two new extensions: * EGL_ANGLE_ggp_stream_descriptor: Introduces a new attribute to CreateWindowSurface. Allows the app to pass in a stream descriptor to VkCreateSurfaceKHR. Mirrors VK_GGP_stream_descriptor_surface. * EGL_ANGLE_swap_with_frame_token: Introduces a new function 'eglSwapBuffersWithFrameTokenANGLE'. This allows the app to pass a GGP frame token down to vkQueuePresentKHR. Mirrors VK_GGP_frame_token. Bug: angleproject:4078 Change-Id: I4313ac4c264e68999905049f661bc64b44f72fab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897315 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 050b124d 2019-06-30T03:26:18 Reland "Vulkan: Debug overlay" This is a reland of e54d0f90d1a165404236fd7abd1b05ddd041a686 This was reverted due to a build failure as a result of a missing virtual destructor in the widget base class. Original change's description: > Vulkan: Debug overlay > > A debug overlay system for the Vulkan backend designed with efficiency > and runtime configurability in mind. Overlay widgets are of two > fundamental types: > > - Text widgets: A single line of text with small, medium or large font. > - Graph widgets: A bar graph of data. > > Built on these, various overlay widget types are defined that gather > statistics. Five such types are defined with one widget per type as > example: > > - Count: A widget that counts something. VulkanValidationMessageCount > is an overlay widget of this type that shows the number of validation > messages received from the validation layers. > - Text: A generic text. VulkanLastValidationMessage is an overlay > widget of this type that shows the last validation message. > - PerSecond: A value that gets reset every second automatically. FPS is > an overlay widget of this type that simply gets incremented on every > swap(). > - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an > overlay of this type. On every vkQueueSubmit, the number of nodes in > the command graph is accumulated. On every present(), the value is > taken as the number of nodes for the whole duration of the frame. > - RunningHistogram: A histogram of last N values. Input values are in > the [0, 1] range and they are ranked to N buckets for histogram > calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay > widget of this type. On vkQueueSubmit, the memory waste from command > buffer pool allocations is recorded in the histogram. > > Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py > processes to create an array of bits, which is processed at runtime to > create the actual font image (an image with 3 layers). > > The overlay widget layout is defined in overlay_widgets.json which > gen_overlay_widgets.py processes to generate an array of widgetss, each > of its respective type, and sets their properties, such as color and > bounding box. The json file allows widgets to align against other > widgets as well as against the framebuffer edges. > > Two compute shaders are implemented to efficiently render the UI: > > - OverlayCull: This shader creates a bitset of Text and Graph widgets > whose bounding boxes intersect a corresponding subgroup processed by > OverlayDraw. This is done only when the enabled overlay widgets are > changed (a feature that is not yet implemented) or the surface is > resized. > - OverlayDraw: Using the bitsets generated by OverlayCull, values that > are uniform for each workgroup (set to be equal to hardware subgroup > size), this shader loops over enabled widgets that can possibly > intersect the pixel being processed and renders and blends in texts > and graphs. This is done once per frame on present(). > > Currently, to enable overlay widgets an environment variable is used. > For example: > > $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste > $ ./hello_triangle --use-angle=vulkan > > Possible future work: > > - On Android, add settings in developer options and enable widgets based > on those. > - Spawn a small server in ANGLE and write an application that sends > enable/disable commands remotely. > - Implement overlay for other backends. > > Bug: angleproject:3757 > Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:3757 Change-Id: I47915d88b37b6f882c686c2de13fca309a10b572 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1780897 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Corentin Wallez fc58af47 2019-09-02T07:46:44 Revert "Vulkan: Debug overlay" This reverts commit e54d0f90d1a165404236fd7abd1b05ddd041a686. Reason for revert: causes compile failure on Linux CFI bot. Sample build: https://ci.chromium.org/p/chromium/builders/ci/Linux%20CFI/14810 Sample log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8903575125463586160/+/steps/compile/0/stdout?format=raw Original change's description: > Vulkan: Debug overlay > > A debug overlay system for the Vulkan backend designed with efficiency > and runtime configurability in mind. Overlay widgets are of two > fundamental types: > > - Text widgets: A single line of text with small, medium or large font. > - Graph widgets: A bar graph of data. > > Built on these, various overlay widget types are defined that gather > statistics. Five such types are defined with one widget per type as > example: > > - Count: A widget that counts something. VulkanValidationMessageCount > is an overlay widget of this type that shows the number of validation > messages received from the validation layers. > - Text: A generic text. VulkanLastValidationMessage is an overlay > widget of this type that shows the last validation message. > - PerSecond: A value that gets reset every second automatically. FPS is > an overlay widget of this type that simply gets incremented on every > swap(). > - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an > overlay of this type. On every vkQueueSubmit, the number of nodes in > the command graph is accumulated. On every present(), the value is > taken as the number of nodes for the whole duration of the frame. > - RunningHistogram: A histogram of last N values. Input values are in > the [0, 1] range and they are ranked to N buckets for histogram > calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay > widget of this type. On vkQueueSubmit, the memory waste from command > buffer pool allocations is recorded in the histogram. > > Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py > processes to create an array of bits, which is processed at runtime to > create the actual font image (an image with 3 layers). > > The overlay widget layout is defined in overlay_widgets.json which > gen_overlay_widgets.py processes to generate an array of widgetss, each > of its respective type, and sets their properties, such as color and > bounding box. The json file allows widgets to align against other > widgets as well as against the framebuffer edges. > > Two compute shaders are implemented to efficiently render the UI: > > - OverlayCull: This shader creates a bitset of Text and Graph widgets > whose bounding boxes intersect a corresponding subgroup processed by > OverlayDraw. This is done only when the enabled overlay widgets are > changed (a feature that is not yet implemented) or the surface is > resized. > - OverlayDraw: Using the bitsets generated by OverlayCull, values that > are uniform for each workgroup (set to be equal to hardware subgroup > size), this shader loops over enabled widgets that can possibly > intersect the pixel being processed and renders and blends in texts > and graphs. This is done once per frame on present(). > > Currently, to enable overlay widgets an environment variable is used. > For example: > > $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste > $ ./hello_triangle --use-angle=vulkan > > Possible future work: > > - On Android, add settings in developer options and enable widgets based > on those. > - Spawn a small server in ANGLE and write an application that sends > enable/disable commands remotely. > - Implement overlay for other backends. > > Bug: angleproject:3757 > Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=geofflang@chromium.org,syoussefi@chromium.org,jmadill@chromium.org Bug: angleproject:3757 Change-Id: Ib08e2e7b1a9449ca097673acb11655df5d2bbf31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778862 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Shahbaz Youssefi e54d0f90 2019-06-30T03:26:18 Vulkan: Debug overlay A debug overlay system for the Vulkan backend designed with efficiency and runtime configurability in mind. Overlay widgets are of two fundamental types: - Text widgets: A single line of text with small, medium or large font. - Graph widgets: A bar graph of data. Built on these, various overlay widget types are defined that gather statistics. Five such types are defined with one widget per type as example: - Count: A widget that counts something. VulkanValidationMessageCount is an overlay widget of this type that shows the number of validation messages received from the validation layers. - Text: A generic text. VulkanLastValidationMessage is an overlay widget of this type that shows the last validation message. - PerSecond: A value that gets reset every second automatically. FPS is an overlay widget of this type that simply gets incremented on every swap(). - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an overlay of this type. On every vkQueueSubmit, the number of nodes in the command graph is accumulated. On every present(), the value is taken as the number of nodes for the whole duration of the frame. - RunningHistogram: A histogram of last N values. Input values are in the [0, 1] range and they are ranked to N buckets for histogram calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay widget of this type. On vkQueueSubmit, the memory waste from command buffer pool allocations is recorded in the histogram. Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py processes to create an array of bits, which is processed at runtime to create the actual font image (an image with 3 layers). The overlay widget layout is defined in overlay_widgets.json which gen_overlay_widgets.py processes to generate an array of widgetss, each of its respective type, and sets their properties, such as color and bounding box. The json file allows widgets to align against other widgets as well as against the framebuffer edges. Two compute shaders are implemented to efficiently render the UI: - OverlayCull: This shader creates a bitset of Text and Graph widgets whose bounding boxes intersect a corresponding subgroup processed by OverlayDraw. This is done only when the enabled overlay widgets are changed (a feature that is not yet implemented) or the surface is resized. - OverlayDraw: Using the bitsets generated by OverlayCull, values that are uniform for each workgroup (set to be equal to hardware subgroup size), this shader loops over enabled widgets that can possibly intersect the pixel being processed and renders and blends in texts and graphs. This is done once per frame on present(). Currently, to enable overlay widgets an environment variable is used. For example: $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste $ ./hello_triangle --use-angle=vulkan Possible future work: - On Android, add settings in developer options and enable widgets based on those. - Spawn a small server in ANGLE and write an application that sends enable/disable commands remotely. - Implement overlay for other backends. Bug: angleproject:3757 Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 56ba54cc 2019-08-08T13:03:34 Support separate read and draw surfaces in eglMakeCurrent Update ANGLE's default framebuffer implementation to support reading and writing to different surfaces within the same framebuffer. Bug: angleproject:2620 Test: EGLSurfaceTest[3] Change-Id: I4b1ea04ca87a751f80cf190bf3adec148fc4fce3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1744746 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill be74c47d 2019-08-13T13:54:15 Capture/Replay: Also capture on postSubBuffer. Necessary to capture from Chrome. Bug: angleproject:3611 Change-Id: Ia9330e0c273e65adaa4171020d0aebb05e100260 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1752013 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill eb1b1646 2019-07-30T17:22:17 Capture/Replay: Fix capture-enabled libs build. Adds a build option to use the capture libraries in the default output location for libGLESv2. With |angle_with_capture_by_default| enabled, libGLESv2 will have capture enabled and the non-capture libGLESv2 is built as libGLESv2_no_capture. Also moves the FrameCapture to be owned by gl::Context. Rearranges the code a bit so that we don't require a separate version of libANGLE for capture. Also implements a read pixels entry point parameter. Bug: angleproject:3611 Change-Id: Ic528e43e4779f794c8b6d0bf35410166dacc81b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1719064 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 612b7417 2019-07-05T11:13:30 Capture/Replay: Add frame capture to cpp files. Capture is implemented mostly via code auto-generation. The capture requires a bit of custom logic for each captured pointer parameter. We handle this by using auto-generation to lay out the base template for each GL call and then custom logic that uses ANGLE's internals to know how much data to capture at which point. Client array pointers are captured before each draw call. Currently only GLES capture is supported. We write out cpp files and an optional data file accompanying each cpp. For small data chunks we inline them in the cpp files. For bigger chunks like texture data we pack them into the data file. Mid-execution capture is not yet supported. Configuring the capture is currently only available by modifying the cpp sources. Both of these features will be implemented in the future. Bug: angleproject:3611 Change-Id: If6d5dac2f7bf363129d42ea9198162aef0d3a4ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1671904 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3ea463bf 2019-06-19T14:21:33 Move event tracer back into common. Requires that we update the TRACE_EVENT macros to accept a platform as an argument. The refactor isn't complete. In order to finish we'd need to ensure we have the Display's PlatformMethods available at all sites. Unblocks adding trace events directly in the perf tests. Bug: angleproject:1892 Bug: angleproject:3117 Change-Id: Iee0ca086ccfe23acab3fc186fb042f018711a94c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1664794 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 124f78c2 2019-06-18T11:48:24 Remove gl::Context parameter from Observer functions. It was only used in exactly one instance in VertexArray. Instead we can cache a bool and avoid needing to pass it around. Will make signaling dirty easier in the Vulkan back-end. Bug: angleproject:3539 Change-Id: Ia570aec051a24a5280df49edc4345c54022b46ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1663838 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e4faae21 2019-05-10T08:27:00 Rename state change notification messages. This makes the style use CamelCase instead of ALL_CAPS. It also cleans up some of the naming. It also changes some uses of the messages in some of the objects to hopefully be more consistent. See the comments added to the enum SubjectMessage in Observer.h for more details. Bug: angleproject:3427 Change-Id: I6dff4f6d335ecf1a27e48df65743b1490bd3025a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1600411 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0f4d72e6 2019-05-06T10:27:34 Add makeCurrent and unMakeCurrent to SurfaceImpl. SurfaceGL had these methods already so they are just moving up the inheritance hierarchy. This ends up simplifying some state tracking we had in our surface implementations. BUG=angleproject:2464 Change-Id: I480588ca8470d9ef507f95e0c0297fe126b3abfb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1595434 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi a254fa28 2019-04-09T14:25:59 Rename getCurrentDisplay to getDisplay There is always only one display that can be associated with a context, so get*Current*Display is confusing. Bug: None Change-Id: Iff3a9fc5ad1154b046bb30d7f46a468802ba7fcc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1558958 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill ab2bfa81 2019-01-15T19:06:47 Enable Chromium clang style plugin for libANGLE. This fixes a few style warnings: * auto should not deduce to raw pointer type * inlined virtual methods are not allowed * non-trivial constructors and destructors should be explicit * inlined non-trivial constructors should not be in-class * missing override keywords Bug: angleproject:3069 Change-Id: I3b3e55683691da3ebf6da06a5d3c729c71b6ee53 Reviewed-on: https://chromium-review.googlesource.com/c/1407640 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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 66f0d2c1 2018-11-30T15:25:36 Make Framebuffer attachments angle::Subjects. Now that there's storage change notifications in the GL front-end we no longer need to give the back-end access to the angle::Subject. The Texture object is a special case where it has mirrored dirty bits. To keep the gl::Texture class notified of when the Impl has dirty bits we make the TextureImpl class an angle::Subject that is observed by the gl::Texture class. This will enable further dirty bits improvements. Bug: angleproject:2966 Change-Id: Id22da0926f51ff4679e58af3e62903f4d7948915 Reviewed-on: https://chromium-review.googlesource.com/c/1347670 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4f6592fa 2018-11-27T16:37:45 Remove gl::Error. Removes several TODOs. Only egl::Error remains. Also slightly decreases binary size. Bug: angleproject:2491 Change-Id: I3a9d1c22eb0884ca9e37362463fddd0083faf826 Reviewed-on: https://chromium-review.googlesource.com/c/1337462 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 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>
Geoff Lang 6ba22ee1 2018-10-26T16:15:40 GL: Implement EGL_ANDROID_get_frame_timestamps. BUG=angleproject:2936 Change-Id: I758d797d185b2de330cce3401bfeef76c7df590e Reviewed-on: https://chromium-review.googlesource.com/c/1302836 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 4024e217 2018-10-17T14:53:29 perftests: Record trace events to JSON file. This allows us to view the timeline of events in the trace event browser. We can extend this to do GPU timestamp queries and analyze when work is actually in flight. The trace is enabled in standalone ANGLE only using the flag --enable-trace with angle_perftests. You can also optionally specify the trace output file with --trace-file <blah>. The default file is ANGLETrace.json. Bug: angleproject:2781 Change-Id: I871f28545d9bf18220b55aaf69e9554dcb4c834d Reviewed-on: https://chromium-review.googlesource.com/c/1259763 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov 2eb54074 2018-08-22T16:41:26 Fix EGLImage pixel format validation This fixes the scenario when EGLImage source and target have different types. For example, a texture is created with unsigned format using glTexImage2D, it is used as a source of EGLImage with eglCreateImageKHR, and then the EGLImage is used to create a renderbuffer target with glEGLImageTargetRenderbufferStorageOES. OES_EGL_image doesn't specify what should happen in this case, but GL implementations (Nexus 5X) seem to allow using this renderbuffer in glFramebufferRenderbuffer and the resulting framebuffer is complete. Thus, in this case, instead of checking whether the renderbuffer format can be used in glFramebufferRenderbuffer, we need to check whether the original texture can be used in glFramebufferTexture2D. Similarly in reverse direction. Also, for the case of source renderbuffer and target texture, presume that glEGLImageTargetTexture2DOES will succeed regardless of renderbuffer format. 1. Add isRenderable and isTexturable checks to egl::Image class, and perform different checks depending on source type. 2. Add isRenderable check to FramebufferAttachment and delegate EGLImage attachments check to egl::Image. 3. Use these checks in validation of EGLImageTargetTexture2D, EGLImageTargetRenderbufferStorage and when checking attachment completeness Bug: angleproject:2567 Change-Id: I8e9f4a2930a4075a4d8464f62582c6825270187e Reviewed-on: https://chromium-review.googlesource.com/1192585 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
LRN 03d132eb 2018-07-14T13:31:35 Support EGL_(WIDTH|HEIGHT) in eglSurfaceAttrib(), fixed resize Setting EGL_WIDTH or EGL_HEIGHT results in mFixedWidth and mFixedHeight changing their values. Whenever the swap chain is tested for needing a resize, surfaces with mFixedSize are treated as if they should be resized to mFixedWidth and mFixedHeight from their current size. This way fixed-size surfaces can be resized - it's enough to do a couple of eglSurfaceAttrib() calls and then either let ANGLE check surface for needing a resize in due course, or force that by calling eglWaitNative(). BUG=angleproject:2725 Change-Id: I2932d8ecd5a2f10500e4aa8583a169aa09bf01bb Reviewed-on: https://chromium-review.googlesource.com/1139055 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e62489f3 2018-07-16T19:12:33 Surface: Use ref count for bindTexImage. This frees up one more use of ProxyContext. It will also keep the bound surface alive until it is unbound from a Texture. Two usages of the proxy context remains. * DisplayD3D::restoreLostDevice. * Display::destroyImage. Bug: angleproject:2714 Change-Id: Ied72c6ebe060d7fc1743b3313e162d540fcbfe02 Reviewed-on: https://chromium-review.googlesource.com/1137878 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e8cc4a64 2018-07-09T09:18:49 Surface: Don't use a BindingPointer for BindTexImage. The BindingPointer pattern isn't necessary. Every time we delete a Texture we call ReleaseTexImage internally. There shouldn't be any time that we keep an orphaned Texture is Surface. This cleans up one place where we were using the ProxyContext. Bug: angleproject:2714 Change-Id: I3b0fd2125d02ea7545922ec6da7f487451bed871 Reviewed-on: https://chromium-review.googlesource.com/1128925 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Geoff Lang 75359664 2018-04-11T01:42:27 Implement EGL_KHR_debug. BUG=angleproject:1618 Change-Id: I790944b49badc910b6c72266469fcb8e86ac4252 Reviewed-on: https://chromium-review.googlesource.com/1019387 Commit-Queue: Geoff Lang <geofflang@chromium.org> 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>
Geoff Lang e1a057e8 2018-06-07T15:09:00 Fully format some files. Change-Id: Id6ea245849696d4c6d7eabc6860c0ac424dd8013 Reviewed-on: https://chromium-review.googlesource.com/1091309 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang bf7b95db 2018-05-01T16:48:21 Create a default framebuffer per surface/context pair on MakeCurrent. Sharing a gl::Framebuffer object between multiple contexts causes problems if contexts are not virtualized because the native framebuffer objects are not shared between these contexts. The FramebufferImpl created should be the glue that binds a specific context to a specific surface. Update the SurfaceImpl implementations to re-create the framebuffer object before passing it to FramebufferGL. No backing resources will be re-created. BUG=angleproject:2464 Change-Id: Id0b13a221c22b71517b25cb5b1ef2392ad2ecdd6 Reviewed-on: https://chromium-review.googlesource.com/1039985 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 1da46774 2018-05-14T14:30:30 Add support for EGL_ANDROID_presentation_time. BUG=angleproject:2506 Change-Id: I46b3c6ac7f259eabfdd8ea5799da6ef563ff81ee Reviewed-on: https://chromium-review.googlesource.com/1057997 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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>
Geoff Lang ce07f967 2018-05-09T11:27:06 Merge the Framebuffer onDestroy and onDestroyDefault methods. Pass the proxy context to the onDestroyDefault call. BUG=angleproject:2464 Change-Id: I47f869d623e238ca3680c962387ba9359e7d3844 Reviewed-on: https://chromium-review.googlesource.com/1052220 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang ccafa62c 2018-05-02T13:07:53 Pass a context pointer to SurfaceImpl::[bind|release]TexImage. BUG=angleproject:2464 Change-Id: I59fd38c626f7076b4065f25601de3e53c1a446ad Reviewed-on: https://chromium-review.googlesource.com/1040051 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 8ceea819 2018-04-10T03:07:13 Refactor packed enum generation to support EGL enums. Convert the very simple EGL texture type enum. BUG=angleproject:1618 Change-Id: Ieea382a282a8f2544f2982627e8445e6e5cea826 Reviewed-on: https://chromium-review.googlesource.com/1019386 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d7518622 2018-03-27T09:44:31 Buffer11: Refactor Subject/Observer pattern. Instead of having a direct/static observer distinction, add two messages for 'Contents Changed' and 'Storage Changed'. This makes Buffer11 itself the subject with two different message handling cases in the onSubjectStateChange methods. Bug: angleproject:2389 Change-Id: I645cd4b7cc7ce51cb7f48a01c7fc72939cbe89fe Reviewed-on: https://chromium-review.googlesource.com/957940 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 888081d5 2018-02-27T00:24:46 D3D11: Refactor dependent Framebuffer state changes. Previously, when a state change would cause a Texture to recreate its storage specific to D3D11, we would use a dependent notification from RenderTarget11 to Framebuffer11 to re-check internal dirty bits. In this new method, we instead set dirty bits on the gl::Frambuffer directly. This also means we use fewer internal objects for these notifications, because we share the same structures between the D3D11 back-end notifications and the top-level notifications we use for Robust init and Framebuffer completeness. This also allows us to get rid of one "if" that we check on every draw call in D3D11. This also introduces a dirty bits guard concept - a shadow set of dirty bits that is checked in dependent state changes to ensure that extra bits aren't set inside syncState. This also implements Framebuffer dirty bits for the D3D9 back-end. This has the side effect of cleaning up the "null colorbuffer" D3D9 workaround. Bug: angleproject:2372 Change-Id: Ie346d39030f4f6df583d735685b0babea4e745a8 Reviewed-on: https://chromium-review.googlesource.com/936691 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d444255a 2018-02-27T22:03:47 Refactor signal utils into Observer pattern. These types were over-generalized. All use cases featured arrays of resources attached to single parent resources. The channel ID is sufficient to identify the child resource in the parent, and having variadic template arguments wasn't necessary. Futhermore we can rename these types to use the common Observer pattern. This should make them more readable to new developers. Also update some classes to inherit from Subject instead of having a member Subject. This cleans up the code in a few places. This should lead to a simpler refactor to allow dependent dirty bits notifications in the Vulkan back-end. In the following patch the signal_utils files will be renamed. They are not renamed in this patch to ensure git history is preserved. Bug: angleproject:2372 Change-Id: I17a3f2c8d92afd4bb3cba2d378c3a2e8a6d7fb11 Reviewed-on: https://chromium-review.googlesource.com/936690 Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 8170eab7 2017-09-21T13:59:04 D3D: Implement robust resource init for Surfaces. BUG=angleproject:2107 BUG=angleproject:2317 Change-Id: I22260e1093dc6c09e4627c62a95ca4088c99e951 Reviewed-on: https://chromium-review.googlesource.com/678480 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 61773640 2018-02-09T10:12:21 Skip PostSubBuffer calls that have zero size. BUG=810411 Change-Id: I8770b69fe4ab8a8f9bacd141c89e7f83f67f15fb Reviewed-on: https://chromium-review.googlesource.com/911589 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho ceffd20c 2018-01-08T16:39:45 Set colorspace of D3D pbuffers according to DXGI format When a EGL pbuffer is created based on a D3D SRGB texture using EGL_ANGLE_d3d_texture_client_buffer, SRGB conversions are performed as if it was an SRGB surface. The value of EGL_GL_COLORSPACE now reflects that correctly. If the pbuffer is bound to a texture and used as a framebuffer attachment, querying GL_FRAMEBUFFER_COLOR_ATTACHMENT also reflects that correctly. The behavior is the same on both the D3D backend, where there is no native interop involved, and on the GL backend using WGL_NV_DX_interop(2). There are a few limitations on the GL backend that relies on native interop: 1. SRGB conversion for textures created this way can't be disabled using the GL_FRAMEBUFFER_SRGB_EXT toggle that's exposed in ANGLE through EXT_sRGB_write_control. This is now documented in the EGL_ANGLE_d3d_texture_client_buffer spec. On the D3D backend this is not a problem since EXT_sRGB_write_control is not supported either way. 2. Creating a pbuffer out of a D3D11 texture with the format DXGI_FORMAT_B8G8R8A8_UNORM_SRGB does not work, even though it was listed as one of the supported formats in the EGL_ANGLE_d3d_texture_client_buffer spec. It's now mentioned that support for this format is optional. BUG=angleproject:2300 TEST=angle_white_box_tests Change-Id: I70ee0646680805e4469291a5b2ce59e92fda009e Reviewed-on: https://chromium-review.googlesource.com/866743 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 9db70de8 2017-07-04T18:28:42 Reland: Implement EGL_ANGLE_iosurface_client_buffer Includes a fix for creating pbuffers with <buftype> EGL_D3D_TEXTURE with EGL_WIDTH and EGL_HEIGHT attributes. BUG=angleproject:1649 TBR=geofflang@chromium.org Change-Id: Id2974b8fab02c3218febfac708b9b034e65cbc53 Reviewed-on: https://chromium-review.googlesource.com/823248 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 7f5c3eb7 2017-12-12T14:54:17 Revert "Implement EGL_ANGLE_iosurface_client_buffer" This reverts commit c7abc08034a30a41748eefc5b628a76d4e2daa8a. Reason for revert: Might have broken Chromium Win10 composition due to validation changes. Original change's description: > Implement EGL_ANGLE_iosurface_client_buffer > > BUG=angleproject:1649 > > Change-Id: I1e72c31d7c9497ad14039a8d3fb97317ab193cb2 > Reviewed-on: https://chromium-review.googlesource.com/559107 > Reviewed-by: Corentin Wallez <cwallez@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Corentin Wallez <cwallez@chromium.org> TBR=geofflang@chromium.org,cwallez@chromium.org Change-Id: I605b710b6d76056d6276b09822cd6ddca277bfd0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:1649 Reviewed-on: https://chromium-review.googlesource.com/822172 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez c7abc080 2017-07-04T18:28:42 Implement EGL_ANGLE_iosurface_client_buffer BUG=angleproject:1649 Change-Id: I1e72c31d7c9497ad14039a8d3fb97317ab193cb2 Reviewed-on: https://chromium-review.googlesource.com/559107 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill acf2f3ad 2017-11-21T19:22:44 Apply Chromium style fixes. This addresses several minor code quality issues that are validated in Chromium, but not yet applied to ANGLE: * constructors and destructors must be defined out-of-line * auto is not allowed for simple pointer types * use override everywhere instead of virtual * virtual functions must also be defined out-of-line Slightly reduces binary size for me (~2k on Win, 150k on Linux). Bug: angleproject:1569 Change-Id: I073ca3365188caf5f29fb28d9eb207903c1843e6 Reviewed-on: https://chromium-review.googlesource.com/779959 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang b433e872 2017-10-05T14:01:47 Change robust resource init into a context creation attribute. Enabled support on OpenGL even through the extension is not fully implemented so that testing with Chromium/Passthrough commmand decoder is still possible. BUG=angleproject:1635 Change-Id: Ia417b1779aace1eae19514325701a79cd33f4ef3 Reviewed-on: https://chromium-review.googlesource.com/678479 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang e159717d 2017-10-05T12:02:30 Filter EGL attributes before passing them to the native driver. Adding extensions that are not native driver extensions would cause surface creation to fail. BUG=angleproject:1635 Change-Id: I2f683ee0560e463aa06f3ba92d0bf3f3d8c8927d Reviewed-on: https://chromium-review.googlesource.com/701602 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill c1abf917 2017-10-03T15:08:33 Fix leaking objects with UniqueObjectPointer. BUG=angleproject:2170 Change-Id: Ie0473022c153c4b70f350cab0c208dd3a0670c40 Reviewed-on: https://chromium-review.googlesource.com/691374 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 05b35b21 2017-10-03T09:01:44 D3D11: Lazy robust resource init. This patch moves the robust resource init logic to the GL front-end. Instead of initializing texture resources immediately on creation in D3D11, it defers the clear until before a draw call in some cases, or skips the update if we can determine if a texture (or other resource) has been fully initialized. Currently lazy init is only implemented for Textures, Renderbuffers, and Surfaces. Various places where lazy resource init is triggered: * Framebuffer operations (Draw, Blit, CopyTexImage, Clear, ReadPixels) * Texture operations (SubImage, GenerateMipmap, CopyTexImage) Some efficiency gains remain to be implemented, such as when a SubImage call fills the entire object. Similarly for Blit, and a few other operations. In these cases we can skip lazy init as an optimization. Edge cases with EGLImage are mostly untested. BUG=angleproject:2107 Change-Id: I2bf3a69b1eae0d4feeb5b17daca23451f1037be8 Reviewed-on: https://chromium-review.googlesource.com/576058 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 40ac783b 2017-07-26T14:38:46 Implement remaining eglQuerySurface and eglSurfaceAttrib enums. BUG=angleproject:2075 Change-Id: I3b500fe80512e7a3e3a9ae9a9724015952c9cbc8 Reviewed-on: https://chromium-review.googlesource.com/587299 Reviewed-by: Jamie Madill <jmadill@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>
Jamie Madill fe54834f 2017-06-19T11:13:24 Proliferate gl::Context. This enables a few small things: it will enable making the platform a property of the Display rather than a global. The same goes for the global logging annotator. Also it ensures all back-end implementations have access to the GL / EGL state when available. Also introduces a smart pointer helper class to angleutils for objects that prefer to be destroyed with a context (gl::Context/egl::Display) parameter. We were using std::unique_ptr in a few places that would not work well with these objects. BUG=angleproject:1156 Change-Id: I59e288a3d6f766ff8a0f4b48ff3a1fbf7489daba Reviewed-on: https://chromium-review.googlesource.com/529706 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov c4d18aac 2017-03-09T18:45:02 Use ErrorStream everywhere Eliminates one more usage of FormatString and its static initializer. Add more ErrorStream types and replace gl::Error and egl::Error with them. BUG=angleproject:1644 Change-Id: Ib498d0ae4b81a332ec71aed7cf709993b154e6bb Reviewed-on: https://chromium-review.googlesource.com/505429 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 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 4fd95d54 2017-04-05T11:22:18 Stop using FramebufferAttachment::Target. Target includes the binding (DEPTH/STENCIL/COLOR), which is not useful for many operations. Simplify this to just passing the mip/layer. This allows us to stop using this internal struct in other classes. BUG=angleproject:1635 Change-Id: Ic5a11781bf45fe7835437fa1e363c190b876d453 Reviewed-on: https://chromium-review.googlesource.com/469152 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Stanislav Chiknavaryan ee218f27 2017-03-22T15:39:13 Re-land eglGetSyncValuesCHROMIUM extension. This reverts commit 20c97cac2a15144b61ceec7404a9e6249c40f50a and adds a few trivial changes to make it build with the current version of ANGLE code. Please see https://bugs.chromium.org/p/chromium/issues/detail?id=614147 for more details on how this extension will be used. Original description: This change adds implementation of eglGetSyncValuesCHROMIUM extension on D3D11 with Direct Composition. This should work on Windows 8.1 and above. The implementation is based on IDXGISwapChain::GetFrameStatistics. Extension documentation: https://chromium.googlesource.com/chromium/src/gpu/+/master/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_get_sync_values.txt BUG=angleproject:1402 Change-Id: I4b77899f31a4c4cf1fa7f20ab12de5a02ccf74d8 Reviewed-on: https://chromium-review.googlesource.com/459217 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6f60d05f 2017-02-22T15:20:11 Make Framebuffer backbuffer constructor take Surface. This allows the Framebuffer to initialize all the attachment info internally. This in turn will allow us to clean up the way we validate WebGL1 depth/stencil attachments. BUG=angleproject:1708 Change-Id: I8871a9791dfce0ac806f4e1367a521610e5283ae Reviewed-on: https://chromium-review.googlesource.com/446130 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6c1f671b 2017-02-14T19:08:04 Add destroy hooks for several GL objects. These hooks allow the back-end renderer to free object resources without having to store pointers to shared device handles for each and every object. This will allow us to save memory on back-ends that really care about memory overhead. There is a downside in that there is more boilerplate in passing gl::Context handles around everywhere. BUG=angleproject:1684 Change-Id: I89463bba8d23f92920e8956650cb73c7fc6d66b7 Reviewed-on: https://chromium-review.googlesource.com/426401 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 70ee0f61 2017-02-06T16:04:20 Add destroy handler to SurfaceImpl. This allows the Vulkan back-end to avoid storing a reference to the VkDevice. This will extend to all the Vulkan object handle wrapper types. BUG=angleproject:1684 Change-Id: I3a98e94bc171ca27f225ce57996c3fdf9581e6e1 Reviewed-on: https://chromium-review.googlesource.com/424229 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill a26c6b7c 2016-12-15T11:27:50 Surface: Make the egl::Config part of SurfaceState. This will be accessible to the Impl, so they won't have to store a copy of the pointer. BUG=angleproject:1319 Change-Id: I298a11a243d3d32f4c885273e55162e6862f3e16 Reviewed-on: https://chromium-review.googlesource.com/419697 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 95401dbb 2016-12-15T11:27:48 Surface: Pass DisplayImpl to initialize and swap. In new back-ends (Vulkan) this will allow us to avoid storing a ref to the Renderer in the Surface class. BUG=angleproject:1319 Change-Id: I3b3f50893070d2993e4e91dd82ee539a083b3727 Reviewed-on: https://chromium-review.googlesource.com/419837 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Stanislav Chiknavaryan 20c97cac 2016-11-04T18:27:56 Squashed commit of the following: commit 0146dfeefa47b520e71f0e74230abd7dac163a79 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:43:03 2016 -0700 Revert "Implementation of eglGetSyncValuesCHROMIUM extension." This reverts commit 5d9f5df01ac5a384d9b7cbb49d9f98a76b62c7ad. commit 0d920fe27bd8e73d831a9002548bde00fea78709 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:23:11 2016 -0700 Revert "Fix EGLSyncControlTest.SyncValuesTest timeout on Windowse Server 2012 R2" This reverts commit d258ca045f31eb43ec01b5501c84e9afd8e82cd6. commit bde8defe53741855bb71fbf27bcb0a91cfafbd01 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:22:58 2016 -0700 Revert "Disabling EGLSyncControlTest.SyncValuesTest" This reverts commit a74183613955bd891f56f6a979a5391c16c64138. commit f78e4b7e97b9d1259878f6902bb6ddeb0aeded87 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:22:36 2016 -0700 Revert "Fix and re-enable EGLSyncControlTest.SyncValuesTest" This reverts commit 138ec92f52da7c0fc8e6df08ac4e4e572bbf6b39. commit f3933e6a04bd23473077d2fd74616023db3c9601 Author: Stanislav Chiknavaryan <stanisc@chromium.org> Date: Fri Nov 4 17:20:26 2016 -0700 Revert "Handle nullptr mSwapChain in SwapChain11::getSyncValues" This reverts commit af7f301f6ba9e5f31d1511142a936a9ba84169d0. BUG=angleproject:1402 Change-Id: I99969e906e316574e9f739141de0e360d1edebd9 Reviewed-on: https://chromium-review.googlesource.com/408752 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Stanislav Chiknavaryan <stanisc@chromium.org>
Geoff Lang 2018c0ba 2015-12-08T11:48:51 Add a EGL_ANGLE_d3d_texture_client_buffer extension. Allows creation of pbuffers from D3D texture objects. BUG=540829 BUG=angleproject:1144 Change-Id: If8ea717ef011608cd01357c217837133d726d3ea Reviewed-on: https://chromium-review.googlesource.com/316804 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang a284f2ff 2015-08-07T16:49:07 Add stubs for EGL_EXT_swap_buffers_with_damage. BUG=512090 Change-Id: I9413d6f5c13b9ea59ab9c923dc6c5d157f344166 Reviewed-on: https://chromium-review.googlesource.com/291652 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Stanislav Chiknavaryan 5d9f5df0 2016-09-27T13:28:25 Implementation of eglGetSyncValuesCHROMIUM extension. This change adds implementation of eglGetSyncValuesCHROMIUM extension on D3D11 with Direct Composition. This should work on Windows 8.1 and above. The implementation is based on IDXGISwapChain::GetFrameStatistics. Extension documentation: https://chromium.googlesource.com/chromium/src/gpu/+/master/GLES2/extensions/CHROMIUM/EGL_CHROMIUM_get_sync_values.txt BUG=angleproject:1402 Change-Id: I306434dd8d85d618b14edfa38fc2a22e50fddacc Reviewed-on: https://chromium-review.googlesource.com/390351 Commit-Queue: Stanislav Chiknavaryan <stanisc@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Yuly Novikov ae0c126a 2016-06-02T23:42:37 Move getSwapBehavior call to be after SurfaceImpl initialize Otherwise, end2end tests crash on Nexus 5X, since the underlying EGL surface doesn't exist at the time of getSwapBehavior call. BUG=angleproject:1362 TEST=angle_end2end_tests on Nexus 5X Change-Id: I550e46ee82592b9d1ea49a3c968d7ffad3ab06f7 Reviewed-on: https://chromium-review.googlesource.com/349430 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 62baf0cf 2016-05-19T13:13:36 Add a shared egl::SurfaceState struct. This structure can share GL-level properties (immutably) with the implementation. BUG=angleproject:1369 Change-Id: I1e9406f18b6b88bb7db2a8f87b5e6d547cc7ecb1 Reviewed-on: https://chromium-review.googlesource.com/342061 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d3a5b185 2016-05-19T13:13:35 Make inheritance heirarchy for egl::Surface. This will allow us to select the Impl constructor more easily createWindowSurface createPbufferSurface createPbufferSurfaceFromClientBuffer createPixmapSurface This in turn lets us pass an EGLImplFactory to the constructor and will allow us to pass in the local SurfaceState to the constructor. BUG=angleproject:1369 Change-Id: I6b13c1548c54bd5c493d59b68bfdaf55226b6bb5 Reviewed-on: https://chromium-review.googlesource.com/342060 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Ian Ewell ec2c0c5e 2016-04-05T13:46:26 Update internal AttributeMap type to EGLAttrib. Newer EGL functions use EGLAttrib to pass in attributes, which can be either 32-bit or 64-bit depending on the system while the old attributes are passed in as EGLints, which are usually 32-bits. To support these newer functions, AttributeMap now uses EGLAttrib internally instead of EGLint, and all the code using AttributeMap has been updated to cast properly. BUG=angleproject:1348 Change-Id: I7c4dd9ef23ea1b1741f3a565502fb5e26bf962d7 Reviewed-on: https://chromium-review.googlesource.com/337162 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Ewell <ewell@google.com>
John Bauman 49ae88ba 2015-12-09T16:44:29 Implement EGL_ANGLE_direct_composition extension On D3D11, if dcomp.dll can be loaded then EGL_ANGLE_direct_composition is exposed. Setting EGL_DIRECT_COMPOSITION_ANGLE as an attrib on a surface will force it to use DirectComposition to draw to the screen, possibly saving power. BUG=524838 Change-Id: I3ea175a97bbca1a3388ffe52fdd1587a2f0c2ce7 Reviewed-on: https://chromium-review.googlesource.com/319214 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: John Bauman <jbauman@chromium.org>
Geoff Lang 7f448b58 2015-12-16T13:31:57 Add an EGL_ANGLE_surface_orientation extension. BUG=angleproject:1262 Change-Id: Ifbb0f5302311a68a0c6f02baaea706cbb7055a52 Reviewed-on: https://chromium-review.googlesource.com/320011 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 666cb828 2016-01-04T17:44:09 Revert "Add an EGL_ANGLE_surface_orientation extension." Compilation warnings on clang. This reverts commit 18cc14b5951842ede85c06dcbc0bba230bcedc45. Change-Id: If58047486116e34ef30c4b317d3fb47cd2349d15 Reviewed-on: https://chromium-review.googlesource.com/319822 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 18cc14b5 2015-12-16T13:31:57 Add an EGL_ANGLE_surface_orientation extension. BUG=angleproject:1262 Change-Id: I863c46c8557604da045447550f7d69831c9f06b5 Reviewed-on: https://chromium-review.googlesource.com/318780 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
John Bauman fe3e46ab 2015-11-24T19:13:55 Add EGL_ANGLE_flexible_surface_compatibility This extension allows users of ANGLE to make contexts current with surfaces that were created with different bit depths. BUG=angleproject:1223 Change-Id: I9072c256e0a36aee1ce41ab69cb9a04240bf0521 Reviewed-on: https://chromium-review.googlesource.com/314935 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: John Bauman <jbauman@chromium.org> Tested-by: John Bauman <jbauman@chromium.org>
Geoff Lang 1b3979b9 2015-12-08T11:39:24 Pass the gl::Texture object into Surface::bindTexImage. BUG=540829 Change-Id: Iee602165e69bfe574821c6f628a745c32932a938 Reviewed-on: https://chromium-review.googlesource.com/316800 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 6b120b9f 2015-11-24T13:00:07 Add checks for FBO attachment layer. We would allow the app to attach layers that were out-of-bounds. Fix this by checking against the underlying resource dimensions. Also rework the code a bit to clean up the texture size query, which is available from the ImageDesc. BUG=angleproject:869 Change-Id: I984f1db16daea6ca650d795884d8ec2cb8f05ebb Reviewed-on: https://chromium-review.googlesource.com/313991 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 47a878c6 2015-08-25T12:28:29 Surface: do not leak the default framebuffer Due to the many merges and changes to 37c3979e47bf93958b426aaa31c1d65aef881b5f the default framebuffer deletion "disappeared". Add it back to the destructor of Surface. Update Surface_unittests and remove one of the two tests as they were equivalent. BUG=524495 BUG=angleproject:1137 Change-Id: I1309285ea00976ae2685628ea3f92731a9259718 Reviewed-on: https://chromium-review.googlesource.com/295153 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 37c3979e 2015-08-20T14:19:46 Revert "Revert "Make the default framebuffer owned by Surface"" Reland the commit after fixing a bug in FramebufferAttachment. This reverts commit 18fdcbcf1d02d3b3b4b5c712f05058f2e8d629c6. BUG=angleproject:891 Change-Id: I07e08de52bfce8d84d070fc7bc15883009298a4d Reviewed-on: https://chromium-review.googlesource.com/294831 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>