src/libANGLE/renderer


Log

Author Commit Date CI Message
Geoff Lang a7af56be 2018-12-14T14:20:28 Vulkan: Print the device id in the renderer string. Add a end2end test that prints all strings to help debug on the bots. BUG=angleproject:3026 Change-Id: Ia524a0d7dac88e55e0aa67412339e646a5564e64 Reviewed-on: https://chromium-review.googlesource.com/c/1378686 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang e1f742af 2018-12-14T14:17:59 GL: Clean up workaround detection. Use functions instead of macros for platform detection so compilation can be checked from any platform. Also makes the workaround detection more readable. BUG=angleproject:3026 Change-Id: I4153f0a2a6a6d5860c7b37f7cc67561895165ed1 Reviewed-on: https://chromium-review.googlesource.com/c/1378685 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 91002266 2018-12-12T16:05:24 Use angle::Result and pass a context pointer to TransformFeedbackImpl BUG=angleproject:3020 Change-Id: Ib0877dd33f9a8c6ea57976642f1b904258cb6a86 Reviewed-on: https://chromium-review.googlesource.com/c/1374273 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi b08457df 2018-12-11T15:13:54 Vulkan: Make flushAfterVertexConversion workaround Nexus5X-specific Workaround added in 611bbaabb28cf4231ad0a138cd7bc21fe559ea02 is likely Nexus5X-specific. This commit detects the phone and enables the workaround only on that. Bug: angleproject:2958, angleproject:3009 Change-Id: I9ab230d4aa690fd92e3d2d84ad98c159128c1093 Reviewed-on: https://chromium-review.googlesource.com/c/1372445 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 611bbaab 2018-12-06T01:59:53 Vulkan: Convert vertex attributes in compute In this commit, VertexArrayVk::convertVertexBuffer() is renamed to VertexArrayVk::convertVertexBufferCpu() to explicitly show it does a CPU readback. A new VertexArrayVk::convertVertexBuffer() function is added that has the same functionality in gpu (with some assumptions, where the CPU fallback is used should those assumptions fail). Currently, the only requirement is that buffer offset/stride are divided by the component size. ConvertVertex.comp is the shader responsible for this conversion, and it implements the functionality in renderer/copyvertex.inc, minus a few functions that are not used in the Vulkan backend. Bug: angleproject:2958, angleproject:3009 Change-Id: I8ec9a5f4672509bcf7b9e352cd27663970ad4653 Reviewed-on: https://chromium-review.googlesource.com/c/1364451 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang be607ad6 2018-11-29T10:14:22 GL: Implement GL_OES_EGL_image_external and GL_OES_EGL_image_external_essl3 Chrome uses external textures as part of its hardware video decode paths on Android. BUG=angleproject:2507 Change-Id: I2af608f84a99843c99a16dcfb9fb2fa28cc8fbb6 Reviewed-on: https://chromium-review.googlesource.com/c/1361480 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 149eb33b 2018-12-08T14:53:49 Vulkan: add possibility to build subset of shaders As the number of internal shaders grow, it's helpful in development time to be able to build variations of a specific shader, instead of building everything every time. With this commit, one can do: $ python gen_vk_internal_shaders.py SubString which will result in compilation of shaders whose name matches the glob *SubString*. Bug: angleproject:2958 Change-Id: I3b18d7e32e2ec4317531a7655eb2c6148cea177b Reviewed-on: https://chromium-review.googlesource.com/c/1369285 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 5c4af666 2018-12-07T06:31:00 Vulkan: unix line endings in generated shaders Bug: angleproject:3007 Change-Id: I466caa92ae337508ae284b6fb8d38f5fa3ea1042 Reviewed-on: https://chromium-review.googlesource.com/c/1366796 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 0c2dc8c3 2018-12-07T08:00:49 Vulkan: Fix dirty default attributes handling When invalidating default attributes, the mask to invalidate was set as the current dirty mask, but it should have been or'ed with it. The following test triggered a validation error on Linux: dEQP.GLES2/functional_default_vertex_attrib_mat4_vertex_attrib_4fv In this test, Vertex Array Bindings and Program dirty bits would set the default attrib dirty mask to all the default attributes, but the handling of Current Values dirty bits would mistakenly remove some of those dirty bits. Bug: angleproject:2786 Change-Id: Ife96621da7646102c1ce3b24e45f405e34a08b40 Reviewed-on: https://chromium-review.googlesource.com/c/1366797 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@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>
Shahbaz Youssefi ec06305b 2018-12-06T01:58:06 Vulkan: Add dynamic vertex buffers to graph With DynamicBuffer outputting BufferHelper objects, these objects can participate in the command graph, i.e. record commands. This means they need appropriate dependencies in the graph as well as pipeline barriers. There are a few users of DynamicBuffer for which this change should be applied to. This change covers vertex attribute buffers. Bug: angleproject:2958 Change-Id: Ic3f8e187639919aba23102bba238de9ce70e6394 Reviewed-on: https://chromium-review.googlesource.com/c/1364450 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 8f1b7a66 2018-11-14T16:02:54 Vulkan: Add DispatchUtilsVK This class provides a set of compute-based internal utilities. Currently, buffer clear and copy are implemented. Other possibilities include more efficient mip map generation, or specialized texture operations. VertexArrayVk::updateIndexTranslation() is updated to convert the GL_UNSIGNED_BYTE index buffer to a GL_UNSIGNED_SHORT one using this class to avoid a CPU readback. The vk::Format class is augmented with a few flags (IsInt, IsUnsigned) to be able to select the appropriate shader based on the format (float, int or uint). Bug: angleproject:2958,angleproject:3003 Change-Id: Ie35519deb3c32a3da5ccf74080c70092c9287f0a Reviewed-on: https://chromium-review.googlesource.com/c/1336307 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi eae081c6 2018-12-03T22:32:32 Vulkan: Fix ASTC_12x12_SRGB_BLOCK support A typo in the .json file made this format unavailable. Bug: angleproject:2357 Change-Id: I3214c6d8a00d9fa731573347b06bded8fb57a918 Reviewed-on: https://chromium-review.googlesource.com/c/1359619 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 96bd8fdf 2018-11-30T14:30:18 Vulkan: Fix format properties queries When querying format properties (in vk::GetFormatProperties), the mandatory feature support table was consulted to check whether a number of texture features are present. If so, the entry from that table was returned. The goal had been to speed up initialization by not issuing device queries if possible. That is, when vk::GetFormatProperties was called on a format, if it supported that select few texture features, the VkFormatProperties entry from the mandatory table would be returned. However, that function found its way to other uses (such as querying buffer format properties, or other image properties beyond the select few). As a result, when the VkFormatProperties from the mandatory table was returned, actual support for these other features was often not tested and assumed false (unless they happened to be mandatory as well). This commit reworks the format feature query functions such that the specific features to be tested are provided when querying the format properties. The mandatory table is consulted as before, and if the entry doesn't contain those features, the device is queried and the results cached. Bug: angleproject:2958 Change-Id: I28d046eb63c3bd5173468aa4cb3e4c63c83e67b1 Reviewed-on: https://chromium-review.googlesource.com/c/1357152 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 654b3c56 2018-12-03T21:59:35 Vulkan: Fix multi-layer image readback The buffer size did not take layer count into account. angleproject: 2828 Change-Id: I94b9294503d785d3e727422550d7e4643eed1917 Reviewed-on: https://chromium-review.googlesource.com/c/1359618 Commit-Queue: Shahbaz Youssefi <syoussefi@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>
Shahbaz Youssefi 4abdf74f 2018-11-28T14:41:10 Vulkan: Add dynamic index buffers to graph With DynamicBuffer outputting BufferHelper objects, these objects can participate in the command graph, i.e. record commands. This means they need appropriate dependencies in the graph as well as pipeline barriers. There are a few users of DynamicBuffer for which this change should be applied to. This change covers index buffers. This commit includes a fix to BufferHelper::copyFromBuffer for WaW hazards. It also includes a fix for a missing pipeline barrier after BufferVk::copyToBuffer. Bug: angleproject:2958 Change-Id: I3e61af56936580b2da20c28c45defece552d9a39 Reviewed-on: https://chromium-review.googlesource.com/c/1352732 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b51eb09f 2018-11-29T10:48:36 Vulkan: Allow bindings to compute stage Includes both binding of resources and updating push constants on the compute shader stage. Bug: angleproject:2958 Change-Id: I5686cbac81e0dd83d0e938cb40f9f9ac7d2ef48a Reviewed-on: https://chromium-review.googlesource.com/c/1355500 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi df8c1053 2018-11-29T11:49:45 Vulkan: Uber-shader generated code optimization Refactors code out of generated functions into a common function and simplifies assertions. Bug: angleproject:2958 Change-Id: I896c2304c3ac1e043c16f9ecf81fa8b72a6b87c0 Reviewed-on: https://chromium-review.googlesource.com/c/1355501 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8dc27f99 2018-11-29T11:45:44 Use packed enum for DrawElementsType. The packing and unpacking take a few extra instructions. But it completely obviates the need for any switches in the validation code. Speed is slightly faster or the similar depending on the back-end. Also add gl_angle_ext.xml to GL entry point generator inputs. This was missing and would cause the code generation to miss certain changes. Bug: angleproject:2985 Change-Id: I1ea41a71db71135000166ead8305ec42d22ff7b3 Reviewed-on: https://chromium-review.googlesource.com/c/1351729 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 471358f3 2018-11-28T15:21:55 Vulkan: fix pipeline stages of memory barriers VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT was used for barriers, but TOP and BOTTOM bits can only be used for execution barriers. These stages don't access memory, so they don't participate in memory barriers at all. A validation error is generated as our current barriers violate this: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-pMemoryBarriers-01184 A note from the spec (see second paragraph in particular): > An execution dependency with only VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT > in the destination stage mask will only prevent that stage from > executing in subsequently submitted commands. As this stage does not > perform any actual execution, this is not observable - in effect, it > does not delay processing of subsequent commands. Similarly an execution > dependency with only VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT in the source > stage mask will effectively not wait for any prior commands to complete. > When defining a memory dependency, using only > VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT or > VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT would never make any accesses > available and/or visible because these stages do not access memory. > VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT and > VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT are useful for accomplishing layout > transitions and queue ownership operations when the required execution > dependency is satisfied by other means - for example, semaphore > operations between queues. Bug: angleproject:2958 Change-Id: Ic616dcad7583db6b386d7d01a774b3ebd71a7081 Reviewed-on: https://chromium-review.googlesource.com/c/1352733 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi a1442ecd 2018-11-26T12:48:10 Vulkan: Uber-shader support For each internal shader, there is now possibly a companion .json file that defines shader variations. The variations consist of a set of flags and a set of enums. Each enum defines a variation that takes one of a few values. Flags are shorthands for 2-value enums. In the shader code, #if can be used to change the shader based on variations derived from flags and enums. On the C++ side, those variations are combined into an index and the appropriate shader is retrieved from a table. Bug: angleproject:2958 Change-Id: Ic4fc7061adb20c047c26624305285e3005092aab Reviewed-on: https://chromium-review.googlesource.com/c/1351117 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 5f01324f 2018-11-26T12:41:12 Vulkan: Allow descriptor pool to allocate different types The internal shaders know exactly what mix of resources they use, so with this change they can make one allocation of multiple types. Bug: angleproject:2958 Change-Id: Ia6f03672b95af4be9618a2f5eeb41ef1c027e810 Reviewed-on: https://chromium-review.googlesource.com/c/1351116 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 5829c03d 2018-11-28T10:39:41 Vulkan: fix ProgramVk never releasing uniform buffers Bug: angleproject:2958 Change-Id: I7fd50e8b2029aad59a35050f401e1cf70d047444 Reviewed-on: https://chromium-review.googlesource.com/c/1354098 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 254b32cb 2018-11-26T11:58:03 Vulkan: Make DynamicBuffer use BufferHelper This is so that the resulting buffers can be written to by the GPU. Additionally, the class is given the ability to create host-visible or device-local buffers, making map()-on-init() optional. This is in preparation for vertex/index transformations in compute. Bug: angleproject:2958 Change-Id: Ib8f5829e33a1e49fa8f80c70dbde74f313ae49ec Reviewed-on: https://chromium-review.googlesource.com/c/1351113 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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 4f2b94cb 2018-11-26T11:38:02 Expose EXT_color_buffer_half_float if RGBA16F is renderable. The EXT_color_buffer_half_float extension spec issue #2 states that none of the added color buffer formats are required to be renderable and the client must check for framebuffer completeness for using them. Chrome exposes the extension if at least RGBA16F is renderable for WebGL. Replicate Chrome's behaviour by loosening our requirements to only expose this extension if an explicit check for RGBA16F renderability succeeds. BUG=angleproject:2984 Change-Id: Id97f3043ebf3fd11b5e9e2d505e57b76baba9716 Reviewed-on: https://chromium-review.googlesource.com/c/1351350 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
James Darpinian 471b8d4c 2018-11-21T15:37:47 WebGL, D3D: Forbid multiple TF outputs in one buffer Implementing a WebGL spec change: https://github.com/KhronosGroup/WebGL/pull/2658 Fixes WebGL 2 conformance test: conformance2/transform_feedback/same-buffer-two-binding-points.html Also applying the change to D3D backends because they can't support multiple transform feedback outputs in one buffer. Bug: chromium:866089 Change-Id: I8d7eda14225c13efb7ca1ed974239332be4e79a6 Reviewed-on: https://chromium-review.googlesource.com/c/1347749 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 5552cdf0 2018-11-26T12:19:26 Vulkan: Create buffer view for BufferHelper Bug: angleproject:2958 Change-Id: Ifa40537bc6003486b37d5d2ac9a2b7f1f5c3d1c2 Reviewed-on: https://chromium-review.googlesource.com/c/1351115 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 1b17f90b 2018-11-26T14:02:02 Vulkan: Implement ANGLE_translated_shader_source BUG=angleproject:2909 Change-Id: Ie59c1206e2ce4940e27fed7887dbee665721049b Reviewed-on: https://chromium-review.googlesource.com/c/1351354 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi bc8cc5af 2018-11-26T12:15:14 Vulkan: Implement vk::BufferView Bug: angleproject:2958 Change-Id: I3f77e694638b4dc060d20a149c3f9c8aed3692d1 Reviewed-on: https://chromium-review.googlesource.com/c/1351114 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 7198ebc4 2018-11-22T14:36:06 GL: Work around Qualcomm sRGB ReadPixels driver bug. When calling glReadPixels on unsized sRGB textures, the data returned is not linearized. Using sized sRGB formats works around this problem. Fix SRGBTextureTest assuming that unsized SRGB formats work in ES3. BUG=angleproject:2977 Change-Id: I413c888ca0c3564ecdc364f3ea693e75ed4f8d6d Reviewed-on: https://chromium-review.googlesource.com/c/1343138 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 617103ed 2018-11-22T13:18:05 GL: Implement GL_NV_fence on top of GLsync objects. When ANGLE exposes an ES2 context, there is often no way to create fence objects because GL_NV_fence is not available. BUG=882580 Change-Id: Ic18539e0243317a188545f3945f6b33d3401f1a8 Reviewed-on: https://chromium-review.googlesource.com/c/1348769 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Tobin Ehlis 573f76b3 2018-05-03T11:10:44 Debug: Add Systrace Markers Update ScopedPerfEventHelper class to add systrace markers by default. This change unifies ANGLE EVENT* macro system so that at the base level in LoggingAnnotator class, systrace markers will be added by default. Modify the base DebugLogger to use char* by default and move any conversions to wchar_t to the Windows specializations where wchar is used. This limits type conversions to only where they're needed. This change also includes some new TRACE_EVENT() calls in the VK backend which will result in systrace markers for those calls on the Android platform. The new build flag "angle_enable_trace" is added to enable the tracing calls. Bug: angleproject:2528 Change-Id: Icefc197d4407e1cd31338710e37865abae6a0b15 Reviewed-on: https://chromium-review.googlesource.com/c/1042785 Commit-Queue: Tobin Ehlis <tobine@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 823d8973 2018-11-13T10:52:40 Vulkan: Internal Compute support While this is not exposed to the front end yet, this commit adds support for creating Compute pipelines for internal usage. Bug: angleproject:2959 Change-Id: I976eae1ce0f736c257b7b4ae0d1c3b2d9f4da5bb Reviewed-on: https://chromium-review.googlesource.com/c/1333972 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi df066e9c 2018-11-13T15:39:47 Vulkan: Remove vk::ShaderType Use gl::ShaderType instead. For now, only GLES2 shaders are supported in ProgramVk. Bug: angleproject:2522 Change-Id: I17bc9afddb6d39cf45fb4dd37f34c7263a3ed515 Reviewed-on: https://chromium-review.googlesource.com/c/1333970 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill dc65c5bd 2018-11-21T11:07:26 Vulkan: Cache pipelines with Shader Programs. This allows for a few nice things. First and foremost it reduces the size of the PipelineDesc, which is now 232 bytes. It also allows us to completely forego pipeline caches for compute shaders. We also allow sharing vertex and fragment shaders among multiple programs for internal shaders. This is good for memory savings. To allow this we keep the shaders as ref counted objects. Bug: angleproject:2522 Change-Id: I2322be5061979d9669a0b25c152359561eeb80ee Reviewed-on: https://chromium-review.googlesource.com/c/1344449 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 836674c2 2018-11-19T11:45:18 Expose GL_CHROMIUM_compressed_texture_etc on top of ES drivers. This allows Chrome to expose the ETC texture formats in WebGL on top of ANGLE. BUG=angleproject:1552 Change-Id: I6a6c3912791e121826b2083421e37df7c0dc38e7 Reviewed-on: https://chromium-review.googlesource.com/c/1342420 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Yuly Novikov ffdbfa39 2018-11-19T12:04:17 Vulkan: warn on VK_ERROR_DEVICE_LOST Bug: angleproject:2657 Change-Id: I076f9d3b8e532fefa614483a822600a9636f7a37 Reviewed-on: https://chromium-review.googlesource.com/c/1342423 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill fde74c07 2018-11-18T16:12:02 Vulkan: Apply point size clamping workaround in NV. It seems to be a regression in recent drivers. Olli contributed this workaround for the GL back-end some time ago. This CL enables it for Vulkan as well on the affected drivers. Bug: angleproject:2970 Change-Id: I37f0caf8d9db073cb880aa1500d1ff7a1eee9d34 Reviewed-on: https://chromium-review.googlesource.com/c/1341108 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 0116a99c 2018-11-09T14:51:46 Vulkan: Emulate Luminance/Alpha with R8G8B8A8 TextureVk::copySubTextureImpl uses the format's pixelReadFunction and pixelWriteFunction and was using the angle format (i.e. the format the texture was created with) instead of the texture format (i.e. the actual format used by the backend) to read and write pixels. This was specifically to make Luminance/Alpha formats work. However, this was incorrect for any emulated format. This commit fixes the function to use the texture format. To avoid issues with Luminance/Alpha, this commit patches the pixel read/write changes for these formats before using them. Bug: angleproject:2913 Change-Id: I8981882b98502d869156a879bb7b5994943ecd8e Reviewed-on: https://chromium-review.googlesource.com/c/1330261 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill e4634a13 2018-11-14T09:54:35 Apply code formatting. Several files were formatted by the code generation script. Bug: angleproject:2957 Change-Id: I8a5cbf2c17297a3644686004a8981ab2305c1ada Reviewed-on: https://chromium-review.googlesource.com/c/1334428 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov b56ddbb7 2018-11-02T16:53:18 Vulkan: Handle VK_ERROR_DEVICE_LOST By notifying egl::Display that the device is lost, which marks all gl::Context as lost, turning all future GL commands to no-ops. Also clear CommandGraph and destroy in flight resources, making sure no more commands are executed on the lost device. Bug: angleproject:2657 Change-Id: I3a1e3646c8ebb37faff507a3c5cec7582a7e05fc Reviewed-on: https://chromium-review.googlesource.com/c/1323849 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 526392dd 2018-11-16T09:35:14 Use angle::Result in front-end (Part 9) This removes the ANGLE_TRY_HANDLE macro. Also the internal uses of gl::ErrorStreamBase. There are remaining uses in the validation code. Further progress will be blocked on removing egl::Error and the use of gl::Error in the validation layer. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: I3e0481f99738f9f24256c10e73f3efcce9826a35 Reviewed-on: https://chromium-review.googlesource.com/c/1334427 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi c30f45d3 2018-11-12T16:37:59 Vulkan: Rename PipelineDesc/Cache to Graphics& PipelineDesc describes a Vertex-Fragment pipeline and PipelineCache (not to be confused with vk::PipelineCache) implements a cache of such pipeline objects. In preparation for Compute support, these data structures are prefixed with Graphics. Bug: angleproject:2959 Change-Id: I9181586fb946b787216ca0b2ad6340f90c3ab55f Reviewed-on: https://chromium-review.googlesource.com/c/1333971 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 872f6ebd 2018-11-15T13:47:37 GL: Put commas between vendor and renderer strings. This allows ANGLE's GL backend's renderer string to be parseable. BUG=882580 Change-Id: I834dc236b1b72edcbc5285bcca4a1962f95f490d Reviewed-on: https://chromium-review.googlesource.com/c/1337463 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Brandon Jones b77884b7 2018-10-10T09:07:12 Autogenerate Repeated Portions of Blit11 Introduces a script to generate Blit11's BlitShaderType enum and shader mapping functions. Bug: angleproject:2870 Change-Id: I5b704f55bdde1706614a519ecb0ee3756f7799e0 Reviewed-on: https://chromium-review.googlesource.com/c/1273725 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 666818ea 2018-11-14T09:54:33 Use angle::Result in front-end (Part 8) Refactors the gl::Texture class and a few related methods. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: Ib9a69d7f507b0dce35abb17b90532f812bf43214 Reviewed-on: https://chromium-review.googlesource.com/c/1291845 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang ccad5e33 2018-11-14T11:01:16 GL: Work around driver returning negative GL_MAX_SERVER_WAIT_TIMEOUT GL_MAX_SERVER_WAIT_TIMEOUT is only allowed to be positive, ensure that with a std::max. BUG=angleproject:2961 Change-Id: I8dd66df24d35c8ae81038d6d9cd0bad0d51f1a80 Reviewed-on: https://chromium-review.googlesource.com/c/1335889 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi f87bd3dc 2018-11-08T00:30:30 Vulkan: Implement EXT_texture_filter_anisotropic Bug: angleproject:2901 Change-Id: If05b4a5270ac1c0bebc3fc854b2aff710e554ce1 Reviewed-on: https://chromium-review.googlesource.com/c/1325730 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi fca8fd62 2018-11-13T13:55:48 Vulkan: Refix cleanup race condition on Context destroy This partially reverts commit 905ee08219faed8ea50e194be0d76ad69faf1026 due to regression caused on startup time. Instead of calling finish before destroying the context, the objects in the Vulkan backend are `release()`ed instead of `destroy()`ed, so they will be kept alive for the duration of current work. Bug: 904846 Change-Id: Ia774470666c4c0d4c1ddc348f685d621243de204 Reviewed-on: https://chromium-review.googlesource.com/c/1333969 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 092481ad 2018-11-08T00:25:50 Vulkan: prepare for ES3 This makes ES3_VULKAN() pass the instantiability test, allowing it to be specified in end2end tests. Bug: angleproject:2950 Change-Id: Ife70a22fb8193f9eebe64bec491a24b47bc76939 Reviewed-on: https://chromium-review.googlesource.com/c/1325729 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang f9143725 2018-11-13T10:10:58 Only use CompositorNativeWindow11 when the window is non-null. SurfaceD3D always instantiates a NativeWindow object even for pbuffers. A null window pointer now creates a CompositorNativeWindow11 instead of a NativeWindow11Win32 which instantiates an RoHelper in the constructor. This is expensive for some use cases that create a pbuffer surface every frame. BUG=angleproject:2956 Change-Id: If43930d4960c2510b6b96291aab971e3f3abf665 Reviewed-on: https://chromium-review.googlesource.com/c/1333967 Reviewed-by: James Clarke <james.clarke@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Yuly Novikov 27780295 2018-11-09T11:19:49 Vulkan: refactor WrappedObject descendants Methods receive VkDevice instead of Context and return VkResult instead of angle::Result now. Bug: angleproject:2657 Change-Id: I3eca8692ad0b3b6e96e31fd433ed14e04384990e Reviewed-on: https://chromium-review.googlesource.com/c/1330105 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Tim Van Patten 29843628 2018-11-01T17:26:51 Fix failing dEQP EGL tests. dEQP-EGL.functional.query_surface.simple.pbuffer#rgb888_depth_stencil dEQP-EGL.functional.query_surface.simple.pbuffer#rgb888_depth_stencil dEQP-EGL.functional.query_surface.simple.pbuffer#rgb888_depth_no_stencil dEQP-EGL.functional.query_surface.simple.pbuffer#rgb888_no_depth_no_stencil dEQP-EGL.functional.query_surface.simple.pbuffer#rgb565_depth_stencil dEQP-EGL.functional.query_surface.simple.pbuffer#rgb565_depth_no_stencil dEQP-EGL.functional.query_surface.simple.pbuffer#rgb565_no_depth_no_stencil dEQP-EGL.functional.query_surface.simple.pbuffer#rgba8888_no_depth_no_stencil dEQP-EGL.functional.query_surface.simple.pbuffer#rgba8888_depth_no_stencil dEQP-EGL.functional.query_surface.simple.pbuffer#rgba8888_depth_stencil dEQP-EGL.functional.negative_api#choose_config dEQP-EGL.functional.negative_api#swap_interval Bug: angleproject:2546 Change-Id: Ie80e3ee3c65f330d2030b4d7da59cb964e4ea0a5 Reviewed-on: https://chromium-review.googlesource.com/c/1313233 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 03d1a5ed 2018-11-12T11:34:24 Vulkan: Use global buffer barriers. This switches from using resource barriers for buffers to using global barriers. This matches the general advised best practice. It also allows us to combine multiple barriers into one. On a draw we might combine all the vertex and index barriers into a single barrier call. We implement this using a bit of extra state tracking in BufferHelper. Bug: angleproject:2828 Change-Id: I196b368804ff50e60d085687a643e5566ba1c5b6 Reviewed-on: https://chromium-review.googlesource.com/c/1309977 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Yizhou Jiang 2fa2147f 2018-11-06T15:52:33 Enable texture multisample extension on ES3 D3D Update maxIntegerSamples, maxDepthTextureSamples and maxColorTextureSamples if the extension is enabled on ES 3.0. TEST=TextureMultisampleTest.* TEST=NegativeTextureMultisampleTest.Negtive* BUG=angleproject:2275 Change-Id: I8c215f990ff5d93611b1bc89de9a43f3d392e8d4 Reviewed-on: https://chromium-review.googlesource.com/c/1319251 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com>
Shahbaz Youssefi d856ca48 2018-10-31T16:55:12 Vulkan: add clear test for emulated stencil or depth formats S8_UINT and D24_UNORM_X8_UINT are the only formats currently that are single-aspect and are possibly emulated with a packed depth-stencil format if it's not supported. A flag to FeaturesVk has been added as a way to force this behavior for the sake of testing. This test is added to ensure the correct clear algorithm is used for this case. Additionally, this case is detected and the other aspect is forcefully cleared to 0 whenever the original aspect is cleared. Bug: angleproject:2815 Change-Id: Ief3039d66bbf46468213b9e3224f7cc7541c3a2e Reviewed-on: https://chromium-review.googlesource.com/c/1312453 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 743899de 2018-10-19T13:53:28 ES31: Implement MAX_SHADER_STORAGE_BLOCK_SIZE Bug: angleproject:1951 Change-Id: I6353e6ed10a8b441bfbebc10fa6a07cde1cae7d8 Reviewed-on: https://chromium-review.googlesource.com/c/1317377 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Shahbaz Youssefi 905ee082 2018-10-26T16:16:34 Vulkan: Fix cleanup race condition on Context destroy In Context::onDestroy(), e7b3fe21866454bd3ea983acede162d34ae03dd8 had moved surface deletion first which down the line caused RendererVk::finish() to be called. bf7b95db6b6f039f6c8797f1f4b930d46a761828 however made surface deletion unnecessary, which means finish was never called. This commit adds an explicit finish in Context::onDestroy(). In truth, the wait is only necessary until all command buffers submitted for this particular context have finished. This optimization is deferred to a possible future work. Bug: angleproject:2811 Change-Id: I56e6c88d3b4a6ec73f70d80d7775a0c85be651ea Reviewed-on: https://chromium-review.googlesource.com/c/1302838 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Eng 1bf18ce9 2018-10-19T15:34:02 Implement GL_ANGLE_multi_draw This patch adds entrypoints glMultiDrawArraysANGLE, glMultiDrawElementsANGLE, glMultiDrawArraysInstancedANGLE, annd glMultiDrawElementsInstancedANGLE Bug: chromium:890539 Change-Id: Ic9c374c53892460f44ca6e73a253b78473ac2dff Reviewed-on: https://chromium-review.googlesource.com/c/1282268 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
Jamie Madill bc5834cd 2018-11-06T11:13:50 Vulkan: Use dynamic state for Viewport and Scissor. This reduces the size of the pipeline cache descriptor under 256 bytes. Further improves the speed of cache query. Has the minor cost of needing more state application during a new command buffer or render pass. Bug: angleproject:2522 Change-Id: I3d71e457a36084ac4748d04fe3c9bab4caad503c Reviewed-on: https://chromium-review.googlesource.com/c/1316888 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 77b2436e 2018-11-05T22:39:29 Vulkan: Reduce PipelineDesc size. This packs the desc into 288 bytes. Down from over 400. The hashing and memcmp functions are sped up considerably. Improves performance in the VulkanPipelineCachePerf test by 50% and also improves performance in the state changing draw call test by 20%. Bug: angleproject:2522 Change-Id: I72ed191a93721b875684f647f806c09be4e66821 Reviewed-on: https://chromium-review.googlesource.com/c/1308460 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 3d86e89b 2018-11-02T16:29:44 Vulkan: properly handle 0-width or 0-height framebuffers The test for whether 0-width or 0-height is not given was doing width != 0 || height != 0 which mistakenly used || instead of &&. Bug: angleproject:2910 Change-Id: Iaa41edffcfe1f8553e8fbefb9bc3b12a7f33a5a6 Reviewed-on: https://chromium-review.googlesource.com/c/1316028 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 1590fcc4 2018-11-01T12:44:39 Add a spec and tests for GL_ANGLE_memory_size. Change the data type of buffer memory sizes to 64 bit integers. BUG=892288 Change-Id: I10e07b86f2ccc0cb61c8d7ee0d439e00d5eb8d3a Reviewed-on: https://chromium-review.googlesource.com/c/1312244 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@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>
James Clarke 99d0463c 2018-09-20T12:12:43 Windows: add support for SpriteVisuals as a native window type. Enable SpriteVisuals to work along side HWNDs so that Angle rendered content can be hosted with Windows::UI::Composition APIs or XamlIslands in desktop Win32 applications. Includes a whitebox test, verified Win7 compatibility For more info see: https://docs.google.com/document/d/1ggv6H-aK1a3pXNMTtMF6h0Bv0rulIeBpBxBBCJYR6Zs/edit?usp=sharing Bug: angleproject:2947 Change-Id: Id005739553be2a6268cd4543f1b07aaf89760422 Reviewed-on: https://chromium-review.googlesource.com/c/1236844 Commit-Queue: James Clarke <james.clarke@microsoft.com> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill caeb1e89 2018-11-01T18:13:22 Vulkan: Allow unlimited simultaneous descriptor sets. This changes the fixed array into a STL vector. Instead of storing Descriptor Pools by value we now store them by pointer. This allows the vector to resize without changing the address of the Descriptor Pool. Also enables some more Vulkan perf tests that were crashing before. Bug: angleproject:2938 Change-Id: I8a88d5315b941c4f54205a9957e2834fe02ada84 Reviewed-on: https://chromium-review.googlesource.com/c/1311395 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 502d2e21 2018-11-01T11:06:23 Vulkan: Crunch RenderPassDesc. This reduces the size of the RenderPass desc from 64 to 12 bytes. Bug: angleproject:2522 Change-Id: Iff2df87ba65be0bd976bba81c76c285cb0fa1ceb Reviewed-on: https://chromium-review.googlesource.com/c/1308459 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 2197dc52 2018-10-30T11:29:58 Vulkan: Implement masked depth & stencil clear This commit also adds tests for clearing depth and stencil with mask/scissor. Bug: angleproject:2540 Change-Id: I30dd840afd6cdd4e3a38c50fcba4c8623513ceb0 Reviewed-on: https://chromium-review.googlesource.com/c/1307585 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Brandon Jones 580baf37 2018-10-24T10:15:18 Recompile D3D11 Blit Shaders Recompile Blit11 shaders with Microsoft HLSL Shader Compiler 9.29.952.3111. Bug: angleproject:2870 Change-Id: I688e5b2ce23ef157c1bb879d5adc49fbecb4dd21 Reviewed-on: https://chromium-review.googlesource.com/c/1298003 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 193a284d 2018-10-30T17:28:41 Vulkan: Split vk::CommandGraphResource. This adds two subclasses: RecordableGraphResource and QueryGraphResource. Each specializes for Buffer/Image/Frambuffer use cases and Query use cases respectively. No virtual functions are added to keep best performance. We also change the CommandGraph API slightly to optimize away the check for a barrier resource. This requires exposing the set current barrier API on the CommandGraph. Bug: angleproject:2828 Change-Id: I1c23f52bfe04cc682a00b245d63c3ac9a651615d Reviewed-on: https://chromium-review.googlesource.com/c/1305994 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0ea96210 2018-10-30T15:14:51 Vulkan: Enable more perf tests. Also fixes the check for the correct UINT index extension that wasn't available on Vulkan. Also includes a workaround for the mock ICD not implementing buffer state for index ranges. Bug: angleproject:2923 Change-Id: Iab35809d15f890525a9e658d4148272c46cf1320 Reviewed-on: https://chromium-review.googlesource.com/c/1308733 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 763cec07 2018-10-26T14:19:54 Vulkan: Add warnings for cache struct packing. This adds diagnostic warnings for packed cache structures. It ensures the packed versions of the structures don't have any unexpected misalignments or inserted members. This gives us consistent behaviour and ensures all memory is initialized. Implemented for Clang/GCC/MSVC. Bug: angleproject:2522 Change-Id: I6ec453a40d292e4a498319ffa767988a502d225e Reviewed-on: https://chromium-review.googlesource.com/c/1302533 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 749589f8 2018-10-25T12:48:49 Vulkan: Remaining disjoint timer query functions The following features where missing in c2b576d9e: - glGetIntegerv with GL_GPU_DISJOINT_EXT: this is currently impossible to query in Vulkan, so 0 is always returned. - glGetIntegerv with GL_TIMESTAMP_EXT: this is a way to query GPU timestamp without performing flushes or waiting for the GPU to finish. There is no direct correspondance in Vulkan; it's implemented by making a small submission, with no dependency to other submissions, in which there is only a timestamp query. Bug: angleproject:2885 Change-Id: I2341bd610db9084c26b6421c6f8949950ffa4de8 Reviewed-on: https://chromium-review.googlesource.com/c/1299873 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 77abad8d 2018-10-25T17:03:48 Remove Context::gatherParams. This won't be used in the future. It saves a few instructions on each entry point. Also refactors a bit of touched code. Also adds in a missed entry point: "glTexStorage2DMultisampleANGLE". Removes related code and moves remaining helper code in params.h into a new file entry_point_utils.h. In total this patch series reduces overhead by up to 5%. Bug: angleproject:2933 Change-Id: Ifb49564597cde6ba82dfc3e185227619fdc62612 Reviewed-on: https://chromium-review.googlesource.com/c/1299478 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 25224e78 2018-10-22T11:56:02 Vulkan: add GPU trace events RendererVk now tries, as best as it can, to match the CPU and GPU timers on init as well as every finish(). A clock-sync event is generated for each such synchronization point. RendererVk::traceGpuEvent() is a new function that, given a command buffer, performs timestamp queries corresponding to GPU events. These queries are read back when done, without incurring GPU bubbles, at which point an event is generated with that timestamp. Bug: angleproject:2908 Change-Id: I08d7d11ff9f8ad6c9f9a9899767c9cd746d0623e Reviewed-on: https://chromium-review.googlesource.com/c/1296954 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Brandon Jones 4a22f4b0 2018-10-23T14:36:47 ES31: Add atomic_uint support to HLSL translator This is the first commit in a series to enable atomic counter buffers. Adds support for atomic counters to the GLSL->HLSL translator using RWByteAddressBuffer. Bug: angleproject:1729 Test: angle_end2end_tests Change-Id: I3b7e08f9256dc9bdbcc02ad8910040f2bc14aeac Reviewed-on: https://chromium-review.googlesource.com/c/1291329 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill bfe31c42 2018-10-25T17:03:47 Remove uses of DrawCallParams. Packing and referencing this structure was causing unnecessary draw call overhead. This improves performance on all the back-ends. Impacts the GL back-end the most. In total this patch series reduces overhead by up to 5%. Bug: angleproject:2933 Change-Id: Ief416ab874e481baf960d02965978a311214a146 Reviewed-on: https://chromium-review.googlesource.com/c/1299477 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill c1fd7376 2018-10-26T22:48:39 Move index range calculations into VertexArray. This is in preparation for removing the entire DrawCallParams struct. This struct was big enough to cause a performance hit on draw call perf tests just by virtue of initializing the fields. Also dereferencing the struct members is slower than reading function parameters since it adds an indirection. Also includes some error refactoring to enable moving code to a shared location. In total this patch series reduces overhead by up to 5%. Bug: angleproject:2933 Change-Id: Ib663f2538c14ac30d4c31fd10d6350be469626e2 Reviewed-on: https://chromium-review.googlesource.com/c/1298380 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Till Rathmann b8543630 2018-10-02T19:46:14 Support GL_OES_texture_border_clamp Added support for GL_TEXTURE_BORDER_COLOR and GL_CLAMP_TO_BORDER in OpenGL/OpenGLES, Direct3D9 and Direct3D11 backends. For integer textures in OpenGLES3 contexts these additional entry points are available now: void glTexParameterIivOES(enum target, enum pname, const int *params); void glTexParameterIuivOES(enum target, enum pname, const uint *params); void glGetTexParameterIivOES(enum target, enum pname, int *params); void glGetTexParameterIuivOES(enum target, enum pname, uint *params); void glSamplerParameterIivOES(uint sampler, enum pname, const int *params); void glSamplerParameterIuivOES(uint sampler, enum pname, const uint *params); void glGetSamplerParameterIivOES(uint sampler, enum pname, int *params); void glGetSamplerParameterIuivOES(uint sampler, enum pname, uint *params); BUG=angleproject:2890 TEST=angle_end2end_tests.TextureBorderClamp* Change-Id: Iee3eeb399d8d7851b3b30694ad8f21a2111f5828 Reviewed-on: https://chromium-review.googlesource.com/c/1257824 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang ad8fe588 2018-10-26T13:06:42 Don't set native blob cache callbacks if the driver doesn't support it. BUG=angleproject:2516 Change-Id: I147705e22a7c694d1f22088a9270c579b0941c7d Reviewed-on: https://chromium-review.googlesource.com/c/1302113 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 6165602f 2018-10-24T15:00:50 Vulkan: Throttle CPU to avoid excessive frame queuing Unthrottled, the CPU can generate and queue an increasingly large number of frames with the GPU lagging behind, especially with vsync enabled. Assuming N swapchain images, this commit adds a wait on fence for the Nth previous frame before submitting new work, that is the CPU is always at most N frames ahead of the GPU. Bug: angleproject:2908 Change-Id: Ieb2bf20168bfe9bc9d8e2219f682b01347c21dec Reviewed-on: https://chromium-review.googlesource.com/c/1296953 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 79927344 2018-10-22T11:41:43 Vulkan: add wrapper for vkEvent Bug: angleproject:2908 Change-Id: Id6c9326f85f9ff17b963078f82bcf486bae66a83 Reviewed-on: https://chromium-review.googlesource.com/c/1296951 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang c3ee7ec0 2018-09-21T16:15:03 Implement EGL_ANDROID_image_native_buffer. BUG=angleproject:2508 Change-Id: I8ef2ce8320edeb336727905055f47bb299dec2ea Reviewed-on: https://chromium-review.googlesource.com/c/1238886 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 5a206950 2018-10-22T09:58:25 GL: Move draw functions from Renderer to Context. This avoids one more function call + register pushing/popping. Slight improvement in the command_buffer_perftests. Bug: angleproject:2877 Change-Id: Ia50a330e62f0bd32266c9f0999810243cbaa41e0 Reviewed-on: https://chromium-review.googlesource.com/c/1293630 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Yizhou Jiang 7818a85c 2018-09-06T15:02:04 Implement GL_ANGLE_texture_multisample API part Support GL_ANGLE_texture_multisample extension. This patch adds enums of multisampled texture and texStorage2DMultisampleANGLE API. TEST=angle_end2end_tests.exe --gtest_filter=TextureMultisampleTest* TEST=angle_end2end_tests.exe --gtest_filter=NegativeTextureMultisampleTest.Negtive* BUG=angleproject:2275 Change-Id: I2cab997edc33aa2d0be6082381545335423f64e0 Reviewed-on: https://chromium-review.googlesource.com/c/804613 Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0cc11c68 2018-10-12T18:07:18 StateManagerGL: Remove setGenericShaderState. We can mutate the BitSetIterator as it clears dirty bits. This removes the risk of doing a double state update. Improves the proformance of the GL back-end state update. Also do an early-out before calling syncDrawArraysState. Bug: angleproject:2763 Change-Id: Idd25bdd67a6aceff05529a533260b661b07c2928 Reviewed-on: https://chromium-review.googlesource.com/c/1262740 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d4f07760 2018-10-19T19:24:07 GL: Apply dirty bit mask on sync state. This prevents us from updating some dirty bits in some operations. It can prevent us from doing things like updating the Program when we don't use it in a GPU operation. Also adds Framebuffer dirty bits to TexImage to work around a bug on the Windows Intel OpenGL driver. Bug: angleproject:2763 Bug: angleproject:2906 Change-Id: I9f69775fb930a9bbcbd40d0f9012d62a9381c9f8 Reviewed-on: https://chromium-review.googlesource.com/c/1292610 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill b8eec4a4 2018-10-18T17:34:38 Use angle::Result in front-end (Part 7) Refactors the gl::FenceNV and gl::Sync classes. Bug: angleproject:2491 Change-Id: I0fe73d1ccf5407f460e173a3061735b330a88511 Reviewed-on: https://chromium-review.googlesource.com/c/1289712 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f4a789f9 2018-10-18T16:56:20 Use angle::Result in front-end (Part 6) Refactors the gl::Program, gl::Compiler and gl::Query classes. Bug: angleproject:2491 Change-Id: I96acecdc6af301a89201bd7f5222a180433e5eb2 Reviewed-on: https://chromium-review.googlesource.com/c/1289711 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ae108bd1 2018-10-18T15:00:38 Use angle::Result in front-end (Part 5) Refactors gl::Buffer and implementation. Bug: angleproject:2491 Change-Id: Ic6860dac2faf33067965e7117ea8e98dc6a8dc7a Reviewed-on: https://chromium-review.googlesource.com/c/1283310 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c2328a15 2018-10-18T15:00:29 Use angle::Result in front-end (Part 4) Handles the gl::Renderbuffer class and its implementation. Bug: angleproject:2491 Change-Id: I3ef718b492dc39ba640c8f68ed80b536f89ff378 Reviewed-on: https://chromium-review.googlesource.com/c/1283309 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@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 32643cea 2018-10-19T11:38:03 Use angle::Result in front-end (Part 2) Handles the gl::Context class and its implementation. Bug: angleproject:2491 Change-Id: I7b7eb0897d131a194f6b563b7e01756fd7adb7e1 Reviewed-on: https://chromium-review.googlesource.com/c/1280742 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill cd0a0a3c 2018-10-18T18:41:57 Introduce SubjectBindingPointer. We can share the same pointer for the subject binding and the binding pointer. This further allows us to optimize buffer re-binding. The shared memory increases cache coherency and reduces the number of instructions needed. Bug: angleproject:2891 Change-Id: Id3162fa79de203f75989e7289ea02cb2ea1bec73 Reviewed-on: https://chromium-review.googlesource.com/c/1270217 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Shahbaz Youssefi c2b576d9 2018-10-12T14:45:34 Vulkan: Implement GL_EXT_disjoint_timer_query - QueryVk::queryCounter() and relevant utils are implemented for the sake of Timestamp queries. - TimeElapsed queries are implemented using two Timestamp queries. Bug: angleproject:2885 Change-Id: Id181bd97f5a24e7e96b3ea1b819483227e64daf0 Reviewed-on: https://chromium-review.googlesource.com/c/1276806 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi c4765aa7 2018-10-12T14:40:29 Vulkan: fix glGetQueryObject not flushing glGetQueryObject* requires forward progress in the queue regardless of whether we are waiting on the result or busy-looping over whether the results are available. This commit calls flush() if the query has pending work. Additionally, this fixes a race condition where glGetQueryObject* may be accessing a query whose corresponding batch has been submitted but not yet executed. In such a case, the GPU may not have already reset the query, so we have to wait on the fence of that batch to make sure the query results are reliably available. Bug: angleproject:2855 Change-Id: I977909c6526c0778a13722a8b8b73e54ad0202f6 Reviewed-on: https://chromium-review.googlesource.com/c/1279125 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>