src/libANGLE/Context.cpp


Log

Author Commit Date CI Message
Geoff Lang 2aaa7b4e 2018-01-12T17:17:27 Add GLES1 targets and stub entry points. * Create a new libGLESv1_CM target. * Merge all autogenerated extension entry points into one file. * Allow creation of ES1 contexts. BUG=angleproject:2306 Change-Id: I446258363a96a3c37d657089dd7c1cff0fa3cf78 Reviewed-on: https://chromium-review.googlesource.com/865718 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill fa920ebb 2018-01-04T11:45:50 Entry Points: Auto-generate extensions EPs. This is partially complete - it is missing the auto-gen for custom ANGLE and Chromium extensions that aren't present in gl.xml. We can upstream some of these extensions, but will also need to make custom handling for some extensions that are too volatile or under- specced to upstream to Khronos. This also tweaks some of the Context method names to match what the auto-generator expects. It also updates some TexStorage entry points. Also includes a specialized error return value for glTestFenceNV. Also removes the TexImage3DOES entry point which was neither used nor accessible to the application. Bug: angleproject:2263 Change-Id: I3667c22b1b15f84ab4c7dfecb5745aaf73d11e76 Reviewed-on: https://chromium-review.googlesource.com/846420 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 007530ea 2017-12-28T14:27:04 Entry Points: Refactor Extensions Part 2. This moves the validation and entry point files to use a consistent syntax. This will facilitate auto-generation. Bug: angleproject:2263 Change-Id: If5d06e97db66783d7b3d7fb1d6365f8218d956ae Reviewed-on: https://chromium-review.googlesource.com/846022 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2b7bbc28 2017-12-21T17:30:38 Entry Points: Refactor Extensions Part 1. This moves the validation and entry point files to use a consistent syntax. This will facilitate auto-generation. Bug: angleproject:2263 Change-Id: Ica2dbffff3898103c6827ae7f6b1154a45d14a85 Reviewed-on: https://chromium-review.googlesource.com/841345 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 62fcf62a 2017-11-30T16:16:12 ES31: Add DispatchComputeIndirect suport for OpenGL backend BUG=angleproject:2270 TEST=dEQP-GLES31.functional.compute.indirect_dispatch.* Change-Id: Id062a80188b2a37f28833aaae8e6d31bac382276 Reviewed-on: https://chromium-review.googlesource.com/802763 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 89c422ad 2017-11-29T18:24:20 ES31: Support memoryBarrier and memoryBarrierRegion APIs BUG=angleproject:2280 TEST=dEQP-GLES31.functional.compute.basic.image_barrier_single dEQP-GLES31.functional.compute.basic.image_barrier_multiple dEQP-GLES31.functional.compute.basic.ssbo_cmd_barrier_single dEQP-GLES31.functional.compute.basic.ssbo_cmd_barrier_multiple dEQP-GLES31.functional.synchronization.* Change-Id: If14debab21247dc4b446e86d1642fbc9376b6dd7 Reviewed-on: https://chromium-review.googlesource.com/798803 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 10a4d434 2017-11-28T14:46:26 ES31: Enable some dirty bits and dirty objects for compute pipeline BUG=angleproject:2265 TEST=dEQP-GLES31.functional.shaders.builtin_var.compute.* angle_end2end_test.ShaderStorageBufferTest31 .MultiStorageBuffersForMultiPrograms Change-Id: Icc3df122602951a2328003c10a76696ab4c9f0d8 Reviewed-on: https://chromium-review.googlesource.com/792951 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez e4477001 2017-12-01T14:39:58 Add PackedEnumBitSet, use it for buffer binding validation Includes angle::BitSetT changes from jmadill@chromium.org BUG=angleproject:2169 Change-Id: I9f896613f5c6cdc91281cb9a00134f67291870d9 Reviewed-on: https://chromium-review.googlesource.com/804177 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Bryan Bernhart (Intel Americas Inc) 2eeb1b34 2017-11-29T16:06:43 WebGLCompat: Fix depthstencil query results. getFramebufferAttachmentParameter returns incorrect result for framebuffers in an inconsistent state. BUG=angleproject:2259 Change-Id: I76fa99f1b8847c30469d344bd93dedd9cf6657bf Reviewed-on: https://chromium-review.googlesource.com/798318 Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jiawei Shao 361df070 2017-11-22T09:33:59 ES31: Implement Geometry Shader resource queries on OpenGL This patch intends to implement all geometry shader related resource queries on OpenGL back-ends. This patch also fixes a memory leak by releasing the geometry shader compiler handle in the destructor of the Compiler. BUG=angleproject:1941, angleproject:2261 TEST=angle_end2end_tests Change-Id: Ieb69c162d2fc6c6550e145d1ec7948c3d36d4d15 Reviewed-on: https://chromium-review.googlesource.com/784552 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill afa02a2f 2017-11-23T12:57:38 ContextImpl: Make flush/finish take a gl::Context. This will more easily allow us to call gl::BindingPointer methods. The binding pointer will be used temporarily in the command graph. This is only temporary since we will likely not be using BindingPointer in the end result code, but it could be necessary for future work. Bug: angleproject:2264 Change-Id: I33cf40ec2a1e334c4abfdcff2ad20bbcda3c9d78 Reviewed-on: https://chromium-review.googlesource.com/789532 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 5d5253a3 2017-11-22T14:51:12 Clean up usage of EXT_debug_marker and KHR_debug in the backends. In RendererGL, the EXT_debug_marker functions were calling the KHR_debug entry points, now they fall back only when EXT_debug_marker is missing. Separated the ContextImpl methods for the two extensions. BUG=781164 Change-Id: I615b5965b705e55eb730ebefa6e27e0ee6d86c31 Reviewed-on: https://chromium-review.googlesource.com/786337 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jiajia Qin 5451d532 2017-11-16T17:16:34 Refactor ES31 entry points BUG=angleproject:2254 Change-Id: I4e837a831e0950330b243bd8aa01831af0a70cc4 Reviewed-on: https://chromium-review.googlesource.com/775604 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Jiawei Shao 89be29a5 2017-11-06T14:36:45 ES31: Implement creation and attaching geometry shader on OpenGL This patch intends to implement the creation of a geometry shader and attaching a geometry shader to a program on OpenGL back-ends. This patch also adds all geometry shader related dEQP-GLES31 test failures to deqp_gles31_test_expectations.txt. BUG=angleproject:1941 TEST=angle_end2end_tests Change-Id: Ib0b497030255b15dacd967e48bc59eef0009af46 Reviewed-on: https://chromium-review.googlesource.com/757979 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 92019431 2017-11-20T13:09:34 Make conversion from GL types to native bools consistant. Some places would compare with "== GL_TRUE" and others with "!= GL_FALSE". This behaviour is not in the OpenGL spec but "!= GL_FALSE" is the most standard and follows the same rules as C and C++. Remove un-necessary validation that params are either GL_TRUE or GL_FALSE. Update some internal storage from GLboolean to bool. BUG=angleproject:2258 Change-Id: I12adbe2d24318a206521ca6ad1099ee7e2bf677e Reviewed-on: https://chromium-review.googlesource.com/779799 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 336129f6 2017-10-17T15:55:40 Use a packed enum for buffer targets. BUG=angleproject:2169 Change-Id: I4e08973d0e16404b7b8ee2f119e29ac502e28669 Reviewed-on: https://chromium-review.googlesource.com/723865 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang ee6884e7 2017-11-09T16:51:11 Generate generic error messages for Error objects without messages. Makes sure that the debug output is fired for all generated errors. BUG=783054 Change-Id: Ia30870cd950c53da892554e0862276d4be5360ac Reviewed-on: https://chromium-review.googlesource.com/761760 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Antoine Labour <piman@chromium.org>
Jeff Gilbert c5de4d29 2017-10-31T15:07:53 KHR_create_context with GLES forbids _KHR reset notification enum. EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT from EXT_create_context_robustness must be used with GLES instead. BUG=angleproject:2213 Change-Id: Icaf3c7550c4eb7cb61c6d4ed37adba7824ca4bc8 Reviewed-on: https://chromium-review.googlesource.com/759122 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 29a20992 2017-11-06T18:23:16 Add back dirty bits for pack / unpack buffer binding BUG=angleproject:2169 Change-Id: I8cee9e1c7565d90022216d62b45f0eec5bc51f14 Reviewed-on: https://chromium-review.googlesource.com/755461 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill c67323a9 2017-11-02T23:11:41 Squash State dirty bits to below 64. This will dramatically speed up performance on 64-bit systems due to the efficiency of angle::BitSet64. Improves performance of the GL back-end on benchmarks quite a bit. Squashes the Pack and Unpack states together. Also moves the current value dirty bits to a single dirty bit, with a separate set for each attribute. Also squashes a multisample dirty bit. Also fixes an incorrect dirty bit in StateManagerGL. We may want to implement a semi-fast version of BitSet64 for 32-bit systems if we find performance is not satisfactory. BUG=angleproject:2188 Change-Id: I4616782bf75413252ede3e3ac752b9ccdb9aab49 Reviewed-on: https://chromium-review.googlesource.com/722423 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7b62cf97 2017-11-02T15:20:49 Refactor TextureFormatMap to store an array. std::map lookups are already showing up as a hot spot during some profile trace analysis. We can elimintate these by only doing a single switch at the entry point level to convert the GL internal format to an internal identifier or type info pointer. This change doesn't completely fix the hot spot, since now we are doing multiple switch statements, but it does remove the std::map storage in TextureCapsMap. It replaces it with a flat std::array indexed by angle::Format::ID, and gives us the option in the future to eliminate all by one switch statement. This should allow for a faster texture caps implementation in Vulkan. This also fixes the missing ANGLE format entries for ETC1 compressed formats. BUG=angleproject:2207 Change-Id: I74ea2082e582a6790d5fde90e33246a618a2da0e Reviewed-on: https://chromium-review.googlesource.com/742375 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill a59fc19f 2017-11-02T12:57:58 Use active textures mask with robust init. This should speed up clearUnclearedActiveTextures considerably. It was showing up as a hotspot when running the aquarium demo with the passthrough command decoder. Also rename the complete textures mask in gl::State to an active textures mask, since it includes incomplete textures. BUG=angleproject:2188 Change-Id: Idf020fc49c1e74f17a8005c3b88516829767b84c Reviewed-on: https://chromium-review.googlesource.com/722421 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 4751aabb 2017-10-30T15:14:52 Fix minor issues with ANGLE_texture_rectangle. * Some texture parameters were not initialized correctly. * Binding points were not created for enableable texture extensions. BUG=angleproject:1650 BUG=angleproject:1523 Change-Id: Id3436fe1dbb4069eafad97e722ac519a6b59e5db Reviewed-on: https://chromium-review.googlesource.com/744446 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 76e471e9 2017-10-21T09:56:01 Vulkan: Implement basic uniforms. This implementation adds one descriptor set with two bindings: one for default vertex uniforms and the other for fragment. It adds two corresponding uniform buffers, and the logic for updating the descriptor sets bound to Vulkan. It doesn't handle much in the way of synchronization and dependency management, or uniform update. If there are only vertex or fragment uniforms the empty uniform buffer is omitted from the descriptor set. If both are missing, there is no descriptor set bound. Note that as our implementation progresses we might not be able to initialize our descriptor sets at link time, due to streaming in uniform data. BUG=angleproject:2167 Change-Id: I4ce4c3879ab454114df43bfac8d87ddf817fc045 Reviewed-on: https://chromium-review.googlesource.com/706340 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 111a99e8 2017-10-17T10:58:41 Check that the requested extension is supported by the backend. Previously, we would only check that the extension was requestable and not verify that the driver could support it. BUG=angleproject:1523 Change-Id: I5273920fc08a20beda54d4afaeb406c6c1c2056f Reviewed-on: https://chromium-review.googlesource.com/723559 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 2e568cfb 2017-09-18T17:05:22 Add generator for packed GL enums. For testing this also converts two unimportant GLenums, gl::BufferUsage and gl::CullModeFace. BUG=angleproject:2169 Change-Id: If1e86a97d0fed3fd567303aca6506ec579503076 Reviewed-on: https://chromium-review.googlesource.com/688000 Commit-Queue: Corentin Wallez <cwallez@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>
jchen10 baf5d945 2017-08-28T20:45:48 ES31: Add UNIFORM support for ProgramInterface Add program resource properties for uniform. BUG=angleproject:1920 TEST=angle_end2end_tests:ProgramInterfaceTest* Change-Id: Ia5cf6219db43b8b1f73efbb3565d21c86e9d3ec0 Reviewed-on: https://chromium-review.googlesource.com/638050 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 a99ed554 2017-09-22T08:10:32 Refactor data conversions for state commands This mainly enforces the rules as descripted in ES 3.10, section 2.2.1 and 2.2.2, by enhancing the "queryconversions" to support more rules, removing the scattered type convertors in "utilities" , "mathutil" and "queryutils", and forcing to only use the convertors in "queryconversions". BUG=angleproject:2165 Change-Id: I73c1dc850e2b3b8a479ece1d9c5eb7ae4ce851fe Reviewed-on: https://chromium-review.googlesource.com/680094 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@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>
Jiawei Shao db342276 2017-09-27T10:21:45 ES31: Implement glSampleMaski on OpenGL This patch intends to implement glSampleMaski on OpenGL backends. Refers to: https://chromium-review.googlesource.com/c/487603 BUG=angleproject:1592 TEST=dEQP-GLES31.functional.state_query.*.sample_mask* TEST=dEQP-GLES31.functional.texture.multisample.*.sample_mask* Change-Id: If5ddd6ab57259593919a482be80fbdbe29f6f54d Reviewed-on: https://chromium-review.googlesource.com/573727 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0f80ed86 2017-09-19T00:24:56 Improve speed of iterating dirty textures. We had a performance regression in the Textures benchmark. What the test was doing was iterating over all possible texture state, ensuring the active texture was dirty every frame. This is an attempt to improve on the speed by not doing as much resetting work in State::syncProgramTextures. It introduces an active textures mask to speed iteration over the active texture set. Also makes a refactoring change to Context to make it easier to limit caps to an implementation maxium. The number of active textures is limited to 64 so they easily fit in the bitset mask, with a limit of 32 per shader stage. No mask is currenly kept for compute shaders. With the fix the performance should be about the same as before (which is good, as the test always sets the textures dirty). Test: TexturesBenchmark.Run/gl_8_textures_5_rebind_3_state_8_mips BUG=chromium:765363 BUG=angleproject:1387 Change-Id: I8bcf95be3671195373573f89f406edaba40aa1be Reviewed-on: https://chromium-review.googlesource.com/670279 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yunchao He a336b90f 2017-08-02T16:05:21 ES31: Impl program pipeline object management entries for GL backend. The program pipeline object management entries are: GenProgramPipelines DeleteProgramPipelines BindProgramPipeline IsProgramPipeline BUG:angleproject:2123 Change-Id: I114d054b90caf2ee3f9befef7439552a1c309bc4 Reviewed-on: https://chromium-review.googlesource.com/629978 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 71c88b31 2017-09-14T22:20:29 Enable [[nodiscard]] for gl::Error. This forces all return values to be checked for gl::Error. Requires quite a bit of minor refactoring. I also added a macro to swallow an error without returning from a function. We could look at storing the errors in the Context at some point, since almost always when we're generating errors that we need to discard we have access to the Context as a parameter. BUG=angleproject:2150 Change-Id: I457e48a30c002eda0993acbcd3180ba87bf169fb Reviewed-on: https://chromium-review.googlesource.com/665173 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 14bbb3f9 2017-09-12T15:23:01 Context: Remove recompilation trigger impl method. Move this down into the D3D11 renderer. Achieve this by passing a mutable pointer to the memory program cache to the ContextImpl. This will allow the D3D11 back-end to more easily sync state then apply state changes. It also cleans up the gl-side Context a bit. BUG=angleproject:1155 Change-Id: Ia2c63c05cf414e0d0b22b69c3ed7128f0e405933 Reviewed-on: https://chromium-review.googlesource.com/659230 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
JiangYizhou 5b03f475 2017-01-09T10:22:53 ES31: Implement getMultisamplefv for D3D part. Implement getMultisamplefv for d3d part.Because standard D3D sample positions from https://msdn.microsoft.com/en-us/library/windows/ desktop/ff476218.aspx are fixed sample pattern,we put the sample positions into a constant array in renderer11_utils.cpp with a function to query it. BUG=angleproject:1590 TEST=dEQP-GLES31.functional.texture.multisample.samples_*.sample_position Change-Id: I6e6006ed1c4e22fe006522e9ffd3297247bee75e Reviewed-on: https://chromium-review.googlesource.com/594970 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 d9cd7b7f 2017-08-30T15:04:25 ES31: Add glGetProgramInterfaceiv API Add API entry and validation checks(GLES 3.1 section 7.3). Add the first 4 interfaces(PROGRAM_INPUT, PROGRAM_OUTPUT, UNIFORM and UNIFORM_BLOCK) implementation. BUG=angleproject:1920 TEST=angle_end2end_tests:ProgramInterfaceTestES31.* Change-Id: Iab80ba332e2a5e2b3e677039359e60a420e3d6b0 Reviewed-on: https://chromium-review.googlesource.com/642729 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 06ef36b9 2017-09-09T23:32:46 Add top-level state sync for Samplers. This also reformats the Sampler class to use a shared state struct with the implementation. It removes the call to sync the sampler state from the StateManagerGL::setGenericShaderState method, since it should all be handled at the front-end now. Also rename 'syncImplState' to 'syncState' methods. BUG=angleproject:1387 Change-Id: I5f0219b719aee99aaaa486ec188b2af0c9128e6a Reviewed-on: https://chromium-review.googlesource.com/648054 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 81c2e253 2017-09-09T23:32:46 Add top-level dirty bits for texture and samplers. These will have to be fleshed out in the back-ends. Also currently uses a single bit for all the bindings, and we can extend this to more fine-grained updates in the future. This patch implements top-level updates for texture completeness. Sampler completeness caches are removed from the Texture class, and replaced by a cache in the gl::State class. The State class also keeps a channel binding to the bound textures so it can be notified when textures might change from complete <-> incomplete. In future CLs we skip updating back-ends if texture state doesn't change. BUG=angleproject:1387 Change-Id: If580b4851303c86f3240e62891f5f6047eefb6a2 Reviewed-on: https://chromium-review.googlesource.com/648053 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7d1f5c60 2017-09-02T15:32:15 Sync dirty objects before Context dirty bits. This allows the dirty objects to notify the context if something needs to be communicated down to the ContextImpl. In this case it means a dirty Texture can notify the Context that it needs to re-apply texture bindings. BUG=angleproject:1387 Change-Id: I162115e51112d1c27c0dab621d1b3d14446af96d Reviewed-on: https://chromium-review.googlesource.com/648052 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8693bdb8 2017-09-02T15:32:14 Add a few missing dirty bit cases. Discovered some of these while investigating Texture dirty bits. BUG=angleproject:1387 Change-Id: I8b170462bfd283e4b0f9d47b7f7ddbaa7957914d Reviewed-on: https://chromium-review.googlesource.com/648051 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jiajia Qin 8a7b3a0c 2017-08-25T16:05:48 Reland 'Remove IndexRange retrieving in validation' This change adds GL_KHR_robust_buffer_access_behavior support. The old change is in https://chromium-review.googlesource.com/c/angle/angle/+/607413 BUG=755897, angleproject:1393, angleproject:1463 Change-Id: I04a1132c3ae8d3a766194df61c4ff7bf0b084f03 Reviewed-on: https://chromium-review.googlesource.com/640750 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Martin Radev 0abb7a2a 2017-08-28T15:34:45 Update multiview state on program executable change Relinking the active program can change its number of views and the state has to be correspondingly adjusted. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I20102a428d7566a8cec5d81eeaa55980665812f4 Reviewed-on: https://chromium-review.googlesource.com/637994 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 54164b0c 2017-08-28T15:17:37 Add getUniform impl methods. This will let us remove some of the uniform data management code in the GL front-end, and simplify the GL back-end. It will also enable us to implement uniform data more efficiently in the D3D11 back-end, and probably Vulkan back-end later. This also implements a new impl method for the ProgramGL class to flag optimized-out uniforms as no longer used, post-link. This is important because otherwise the optimized uniforms get assigned valid locations, and then the getUniform calls are expected to succeed. We also use a workaround for uniform value queries for the GL back-end. It seems as though some drivers (seen on NVIDIA and AMD) may not properly clamp to the maximum representable integer value when querying out-of-range floating point values. Work around this by always calling the driver with the proper type and then casting the value in ANGLE. BUG=angleproject:1390 Change-Id: I03dc2382e7af52455c356a2bf3971a4d1bd46ec6 Reviewed-on: https://chromium-review.googlesource.com/616785 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 70b5bb00 2017-08-28T13:32:37 Rename gl::FenceSync to gl::Sync. The spec refers to Sync objects, FenceSyncs being a subtype. The motivation for this fix is to clear up the FenceSync_ entry point for auto-generation. BUG=angleproject:1309 Change-Id: I94c440476d701628575e7a3eea68b6dd110f41c3 Reviewed-on: https://chromium-review.googlesource.com/636516 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3ef140a9 2017-08-26T23:11:21 Finish refactoring the rest of the ES3 entry points. BUG=angleproject:747 Change-Id: I3da02120bfff5f33f15a5a9dd45ec99fd654425f Reviewed-on: https://chromium-review.googlesource.com/636518 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7f0c5a4b 2017-08-26T22:43:26 Refactor sync EPs (plus one extra). More entry point validation refactor for auto-gen. BUG=angleproject:747 Change-Id: I9462a28838df3f265e1401f66c838cc5a73d511f Reviewed-on: https://chromium-review.googlesource.com/636517 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Martin Radev 18b75bad 2017-08-15T15:50:40 D3D11: Handle Clear* commands for layered framebuffers According to the ANGLE_multiview spec, Clear* commands only affect the range of attached layers to the multi-view layered framebuffer. The patch extends ImageIndex so that the range of attached layers is tracked and a render target view can be created with that range of texture array slices attached. The special case of scissored clears for depth and stencil attachments is handled by instancing the same number of quads as there are views and selecting the layer within a geometry shader. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Ibea248b980513f83d918652030a72c62c7ecd88b Reviewed-on: https://chromium-review.googlesource.com/632256 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 12e957f8 2017-08-26T21:42:26 Refactor uniform block and other query EPs. Also some minor fixes to validation and error messages. BUG=angleproject:747 Change-Id: I4f97a45c2d39a8deec2255620e5cc2bcb8cad7b9 Reviewed-on: https://chromium-review.googlesource.com/637126 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f0dcb8b5 2017-08-26T19:05:13 Refactor transform feedback EPs. BUG=angleproject:747 Change-Id: I4891966cd7b3d478980202e795742e15dd1dcb01 Reviewed-on: https://chromium-review.googlesource.com/637125 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d7576737 2017-08-26T18:49:50 Refactor VAO entry points. This also touches the extension EPs for ES2. BUG=angleproject:747 Change-Id: Iaa04d97465e518f6b0496e64bc7a737914709b8f Reviewed-on: https://chromium-review.googlesource.com/637124 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c8c95817 2017-08-26T18:40:09 Refactor uniform matrix entry points. This should also slightly speed up some of the validation. BUG=angleproject:747 BUG=angleproject:1390 Change-Id: I60735e2773788aef3f535bf7d3d8cd27bc4df5b1 Reviewed-on: https://chromium-review.googlesource.com/637123 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f0e0449e 2017-08-26T15:28:42 Format ES3 query entry points. Also refactor some query extension entry points. BUG=angleproject:747 Change-Id: I5a8a3b2616a3872b5645a655641ec9c12739f804 Reviewed-on: https://chromium-review.googlesource.com/636062 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ff325f1b 2017-08-26T15:06:05 Refactor ES3 uniform entry points. This should improve validation speed slightly because it allows us to move the ES3-only check into the ES3-only code, and make it a bit simpler. BUG=angleproject:747 BUG=angleproject:1390 Change-Id: I41f9ffef1c6a552fde924e62e481831f07b1503a Reviewed-on: https://chromium-review.googlesource.com/636061 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill a836b466 2017-08-16T14:58:35 D3D11: Allow no-op pixel shader output. On HLSL 4+, the debug runtime issues a warning when we try to render to a color output in the pixel shader that doesn't have a matching render target bound. This happens when doing a depth or stencil-only render pass. We only need to bind a dummy output in HLSL 3, so tighten the workaround we had in place and fix the warning for D3D11. BUG=angleproject:2025 Change-Id: I16ba9e907f3a6e59afff93fe4583d084cbdf42c5 Reviewed-on: https://chromium-review.googlesource.com/617268 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Martin Radev 82ef774b 2017-08-08T17:44:58 Save layered multiview end-point's arguments into attachment's state Handle glFramebufferTextureMultiviewLayeredANGLE calls by saving the arguments into the attachment's state. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I9d7c0e00fe9e917ad2f9d903a39f30b2546dc7a3 Reviewed-on: https://chromium-review.googlesource.com/609960 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yunchao He a438f4e7 2017-08-04T13:42:39 Fix some style issues BUG=angleproject:2123 Change-Id: Ic3c70c7148297662d4fd9e08edcd208f5a1cc885 Reviewed-on: https://chromium-review.googlesource.com/601370 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
jchen10 880683b1 2017-04-12T16:21:55 ES31: Add glGetProgramResourceiv API Add API entry and validation checks(GLES 3.1 section 7.3). Add the first 2 interfaces(PROGRAM_INPUT and PROGRAM_OUTPUT) implementation. BUG=angleproject:1920 TEST=angle_end2end_tests:ProgramInterfaceTestES31.* Change-Id: I50057f7b99f4dc7c23ca87fa9b797ca424f66e3d Reviewed-on: https://chromium-review.googlesource.com/475075 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 13c0dd46 2017-07-04T18:27:01 Add texture rectangle extension. This is needed to support binding IOSurfaces to textures on OSX. This commit adds support in the API and tests, but didn't need to implement compiler changes as it already supported ARB_texture_rectangle. Implementation of CHROMIUM_opy_texture for rectangle texture and the spec are left for follow-up commits. Change-Id: I45c66be763a9d3f6f619640f9f95f39b05c70867 Reviewed-on: https://chromium-review.googlesource.com/559106 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 4c19a8a8 2017-07-24T11:46:06 D3D11: Update cached dynamically recompiled programs. This change makes it so that when we need to recompile a program on a draw call, we also update the cache. It also streamlines the internal queries of the dynamic vertex and fragment shaders such that we only update the input and output signatures a single time per draw. This should also facilitate dirty bit implementations for the D3D11 back- end. BUG=angleproject:2116 Change-Id: Iccb0501b700bc894f40a8c68d7f297ff0c8f46bd Reviewed-on: https://chromium-review.googlesource.com/531798 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill b6664925 2017-07-25T12:55:04 Add error handling macro to Context. This is a small specialized macro to remove all the redundant handleError calls and return value checking. Also add a Context::prepareForDraw member that will be used in follow-up patches to do necessary work prior to a draw call. BUG=angleproject:2107 BUG=angleproject:2116 Change-Id: I8a32d2206c218fcca5236abfd3f2ce370296ca99 Reviewed-on: https://chromium-review.googlesource.com/585288 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 1da00653 2017-06-20T17:16:25 Remove IndexRange in DrawElements functions This change will remove IndexRange parameter in DrawElements functions. And calculate it until we truly need it. Meanwhile we add direct drawing path to avoid retrieving index range for DrawElements* functions in D3D11 backend. This change may not bring much performance improvement since we still need to retrieve index range in validation at the beginning of every DrawElements* call entry point. BUG=angleproject:1393 Change-Id: I86a8739c0893954c94eb398db62820ced7871565 Reviewed-on: https://chromium-review.googlesource.com/544634 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill a779b610 2017-07-24T11:46:05 Smart caching of VAO input layout. Don't recompute the cached attribute layout for a program if the vertex array info hasn't changed. We can use the Serial class to know when a vertex array has identical state. BUG=angleproject:1156 Change-Id: Ia11f6ac268f63c3299f6d6d80c2866009cb8429c Reviewed-on: https://chromium-review.googlesource.com/529768 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Martin Radev 5dae57b0 2017-07-14T16:15:55 Save side-by-side function arguments into attachment's state Handle glFramebufferTextureMultiviewSideBySideANGLE calls by saving the arguments into the attachment's state. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Idc5441d673b48640f47415b07b2854fbdf566c8d Reviewed-on: https://chromium-review.googlesource.com/574915 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Martin Radev 137032d9 2017-07-13T10:11:12 Validate ANGLE_multiview end-points The patch adds validation for the ANGLE_multiview end-points and propagates the calls to the unimplemented stubs in Context. The patch also removes the glFramebufferTextureMultiviewSideBySideRobustANGLE end-point because the size of the viewport offsets buffer can trivially be computed from the number of views. BUG=angleproject:2062 Change-Id: I9a10bc00c19825e586d3df2750fabea4daf5ef8f Reviewed-on: https://chromium-review.googlesource.com/573861 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b3f26b9e 2017-07-19T15:07:41 Add a zero-filled scratch buffer to Context. We need this in a few places for handling resource init. Centralize this in the context so we don't have to recreate and re-fill a large zero buffer. BUG=angleproject:2107 Change-Id: Icf9ce417e7ee3498f03e47741dfff89e81b49519 Reviewed-on: https://chromium-review.googlesource.com/576057 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
jchen10 191381fd 2017-04-11T13:59:04 ES31: Add glGetProgramResourceLocation API Add API entry and validation checks(GLES 3.1 section 7.3). Add the first 2 interfaces(PROGRAM_INPUT and PROGRAM_OUTPUT) implementation. BUG=angleproject:1920 TEST=angle_end2end_tests:ProgramInterfaceTestES31.* Change-Id: I5128cda43b0d9176c910b036cdc76bf37757670e Reviewed-on: https://chromium-review.googlesource.com/474212 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Martin Radev e5285d29 2017-07-14T16:23:53 Handle ANGLE_multiview state queries The patch extends glGetIntegerv and glGetFramebufferAttachmentParameteriv logic to handle the new tokens from the ANGLE_multiview extension. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: Ide145279cd7b58cd03502458d7d3a1a0f5e9e86d Reviewed-on: https://chromium-review.googlesource.com/573780 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Shao dde78e8c 2017-05-22T14:13:27 ES31: Implement Vertex Attrib Binding on OpenGL This patch intends to implement Vertex Attrib Binding on OpenGL back-ends: 1. Add supports for updating vertex attributes by Vertex Attrib Binding APIs. 2. Refactor the process of updating vertex attribtues in class VertexArray to make it easier to implement this feature. BUG=angleproject:1593 TEST=dEQP-GLES31.functional.vertex_attribute_binding.* Change-Id: I800e61518c552b94b84c415895ad31668b0a84b2 Reviewed-on: https://chromium-review.googlesource.com/510251 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c43be720 2017-07-13T16:22:14 Implement ANGLE_program_cache_control extensions. This will give the browsers the ability to control the cache size, query and populate the contents, and trim cache contents on memory pressure. BUG=angleproject:1897 Change-Id: I6edaa7d307b890223db98792d5b074e4a7fdfaa4 Reviewed-on: https://chromium-review.googlesource.com/563606 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 50c562de 2017-06-06T14:43:30 Re-land: Don't expose non-conformant multisampling modes on GL Re-landing with a fallback for failed internal format queries to work around issue seen on Shield TV. Also fixed wrong handling of integer RG formats in isRequiredRenderbufferFormat. Some NVIDIA GL drivers expose non-conformant multisampling modes. The conformance of multisampling modes can be queried using the extension NV_internalformat_sample_query. Use it to filter out the non-conformant modes from the modes that are exposed by ANGLE. The MAX_SAMPLES value and other similar values stored in caps also need to be lowered to match the maximum number of samples exposed for required formats. There seems to be an NVIDIA driver bug related to querying STENCIL_INDEX8 multisample format. Work around this by querying DEPTH24_STENCIL8 instead. There's also some confusion around whether RGB9_E5 should be renderable. Once the floating point texture extensions got rolled into the core GL spec, it was eventually made clear that RGB9_E5 is intended not to be renderable. The extension specs that predate float textures in the core spec do suggest that it would be renderable, but in practice drivers that advertise the extension strings don't reliably implement RGB9_E5 as renderable. Solve this by disabling it as a renderable format and adding an explanatory comment. BUG=chromium:682815 TEST=angle_end2end_tests, dEQP-GLES31.functional.state_query.internal_format.renderbuffer.* Change-Id: I727f03045a1534d6764b571e6d839243705d25b3 Reviewed-on: https://chromium-review.googlesource.com/551957 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3244736a 2017-06-28T14:53:52 Use MemoryProgramCache. Add the member functions for saving and loading from the binary cache, and hook them into the Program class. Requires that the Renderer supports the program binary extension. BUG=angleproject:1897 Change-Id: I2dc8d21b02da705ded58c5cd1943562c9c97c49b Reviewed-on: https://chromium-review.googlesource.com/522874 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 96a483bc 2017-06-27T16:49:21 Add a ResourceMap class for faster GL resource maps. This gives a very fast query time for handles that are within a fixed range. For WebGL, where we don't allow create-on-bind, this will be 100% of the time, unless we create a very large number of resources. It is implemented as a two-tier map - the first uses a flat array to index into a handle buffer. The second tier uses a map for out-of- range values. BUG=angleproject:1458 Change-Id: I421bb3725cf523918cdfdbfaab035ad0dd3bf82d Reviewed-on: https://chromium-review.googlesource.com/544684 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yuly Novikov c8a8b843 2017-06-28T01:16:41 Revert "Don't expose non-conformant multisampling modes on GL" This reverts commit 3cd0dd370f08e7126fe19b761206280c64f80cd1. Reason for revert: crashes on NVIDIA Shield TV https://build.chromium.org/p/chromium.gpu.fyi/builders/Android%20Release%20%28NVIDIA%20Shield%20TV%29/builds/1816 Original change's description: > Don't expose non-conformant multisampling modes on GL > > Some NVIDIA GL drivers expose non-conformant multisampling modes. The > conformance of multisampling modes can be queried using the extension > NV_internalformat_sample_query. Use it to filter out the > non-conformant modes from the modes that are exposed by ANGLE. > > The MAX_SAMPLES value and other similar values stored in caps also > need to be lowered to match the maximum number of samples exposed > for required formats. > > There seems to be an NVIDIA driver bug related to querying > STENCIL_INDEX8 multisample format. Work around this by querying > DEPTH24_STENCIL8 instead. > > There's also some confusion around whether RGB9_E5 should be > renderable. Once the floating point texture extensions got rolled > into the core GL spec, it was eventually made clear that RGB9_E5 > is intended not to be renderable. The extension specs that predate > float textures in the core spec do suggest that it would be > renderable, but in practice drivers that advertise the extension > strings don't reliably implement RGB9_E5 as renderable. Solve this > by disabling it as a renderable format and adding an explanatory > comment. > > BUG=chromium:682815 > TEST=angle_end2end_tests, > dEQP-GLES31.functional.state_query.internal_format.renderbuffer.* > > Change-Id: I2218e3a23ea7b48a0615fea77a91897dc7d5fe9e > Reviewed-on: https://chromium-review.googlesource.com/525515 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> TBR=geofflang@chromium.org,jmadill@chromium.org,cwallez@chromium.org,oetuaho@nvidia.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: chromium:682815 Change-Id: I1ebdf52c3fab1526f5a561ac4c8555e305ef2243 Reviewed-on: https://chromium-review.googlesource.com/551164 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill ffe00c03 2017-06-27T16:26:55 Add program cache transform feedback workaround. On Qualcomm devices, they don't seem to correctly save transform feedback info. Work around this by disabling caching on these devices. This mirrors a Chromium workaround. BUG=angleproject:2088 Change-Id: I6496d2fb6a03788379a6968bcd5eb3a9cb9d15d4 Reviewed-on: https://chromium-review.googlesource.com/549981 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 761b02c8 2017-06-23T16:27:06 Add an applyNativeWorkarounds context impl hook. This method can allow the implementation to override the Context's workarounds. Use this design pattern now that we have access to the gl::Context everywhere - we don't need to cache a local copy in the Renderer objects. This will be used to apply a Shader Program Cache workaround on the GL level, that will only be used for the GLES back-end on Qualcomm. BUG=angleproject:2088 Change-Id: I6da25c5c29c3ba01b8820c5234d1b92dd2d2121a Reviewed-on: https://chromium-review.googlesource.com/549980 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 65ec0b2e 2017-03-28T16:10:52 ES31: Add support for bindImageTexture on GL backend This patch refers to https://chromium-review.googlesource.com/c/380636/ BUG=angleproject:1987 Change-Id: If621eed6ecaa7298214843a2a133801ca1487b03 Reviewed-on: https://chromium-review.googlesource.com/462088 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 3cd0dd37 2017-06-06T14:43:30 Don't expose non-conformant multisampling modes on GL Some NVIDIA GL drivers expose non-conformant multisampling modes. The conformance of multisampling modes can be queried using the extension NV_internalformat_sample_query. Use it to filter out the non-conformant modes from the modes that are exposed by ANGLE. The MAX_SAMPLES value and other similar values stored in caps also need to be lowered to match the maximum number of samples exposed for required formats. There seems to be an NVIDIA driver bug related to querying STENCIL_INDEX8 multisample format. Work around this by querying DEPTH24_STENCIL8 instead. There's also some confusion around whether RGB9_E5 should be renderable. Once the floating point texture extensions got rolled into the core GL spec, it was eventually made clear that RGB9_E5 is intended not to be renderable. The extension specs that predate float textures in the core spec do suggest that it would be renderable, but in practice drivers that advertise the extension strings don't reliably implement RGB9_E5 as renderable. Solve this by disabling it as a renderable format and adding an explanatory comment. BUG=chromium:682815 TEST=angle_end2end_tests, dEQP-GLES31.functional.state_query.internal_format.renderbuffer.* Change-Id: I2218e3a23ea7b48a0615fea77a91897dc7d5fe9e Reviewed-on: https://chromium-review.googlesource.com/525515 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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>
Jamie Madill 61e16b44 2017-06-19T11:13:23 Context: Bind current display/surface. Looking at the EGL spec, it says for eglGetCurrentDisplay: "The display for the current context in the calling thread, for the current rendering API, is returned." This implies that MakeCurrent binds a display to a Context. There's also pretty clear language for the read/draw Surface as well, that they can only be bound to one Context/thread at a time. Hence we don't need to duplicate this storage in the egl::Thread structure, merely storing a pointer to the current Context, which has access to the read/draw Surface and current Display. BUG=angleproject:1156 Change-Id: Ia3b99d50b3591012c43e851834c1af02ff62a33f Reviewed-on: https://chromium-review.googlesource.com/538865 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d04908bc 2017-06-09T14:15:35 Refactor ProgramBinary entry points. These will need to set dirty bits for the program, and this is best done via the Context. BUG=angleproject:747 Change-Id: I1379d2d4be0e94206c0aa7cb1546aa1a591f23ff Reviewed-on: https://chromium-review.googlesource.com/529767 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
JiangYizhou 165361ca 2017-06-07T14:56:57 Entry point refactoring Refactor texStorage2D and texStorage3D. BUG=angleproject:747 Change-Id: Id5ab6bbff5ce6debc84318e28b12683bf8b106b1 Reviewed-on: https://chromium-review.googlesource.com/526371 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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 bd044ed8 2017-06-05T12:59:21 Defer shader compiles when possible. When using the program binary memory cache inside ANGLE, this will give a potential fast path. If the user doesn't query the shader compile status or info log before calling LinkProgram, then we can check the program cache before translating the program, and if it finds a hit, we don't even need to call the translator. To preserve the shader settings at compile time, a reference to the current shader translator is kept in a binding pointer on the call to compile. This mirrors a similar implementation in Chromium's command buffer. Also the compile options and source are cached at compile to preserve the correct shader state. BUG=angleproject:1897 Change-Id: I3c046d7ac8c3b5c8cc169c4802ffe47f95537212 Reviewed-on: https://chromium-review.googlesource.com/517379 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2f348d2a 2017-06-05T10:50:59 Make gl::Compiler reference-counted. This is helpful for implementing program binary caching in ANGLE. in order to maintain the current behaviour in Chrome, we will need to defer shader compilation until link time. Since WebGL allows the app layer to enable and disable extensions explicitly, the app can enable or disable an extension between the calls to glCompileShader and glLinkProgram. Then, if we're deferring shader compilation, we will have to preserve the extension settings at the time of the call to compile, not the current settings at the time of link. Making the compiler reference-counted gives us a pretty simple and robust solution. This also changes the Context class to lazily init the shader compiler. Lazy init prevents any unexpected nulls, and also ensures the releaseShaderCompiler does exactly that: just releases the shader compiler, and does not immediately re-initialize it. BUG=angleproject:2044 Change-Id: I0f0eeb4eb94dc4eee238f92482804a0921c77df0 Reviewed-on: https://chromium-review.googlesource.com/522868 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: 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 948bbe51 2017-06-01T13:10:42 Redesign robust resource init as a display extension. Also correct the enum allocation to values that are available to ANGLE. BUG=angleproject:1635 Change-Id: I443f5654aa6a5049b4a1ae4c253cd6473b4e446e Reviewed-on: https://chromium-review.googlesource.com/520002 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 231c7f56 2017-04-26T13:45:37 Apply clang-format to many files. This cleans up the formatting in many places. BUG=None Change-Id: I6c6652ebc042f1f0ffecced53582d09d66b4f384 Reviewed-on: https://chromium-review.googlesource.com/487884 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill be849e4f 2017-05-02T15:49:00 GLES2: Clean up entry points for auto-gen. This cleans up a few things: * refactors a few remaining missed EPs * removes unnecessary includes * rename one Context entry point * moves some ES2 EP validation to validationES2 The last item makes for a significant diff, but this is a refactor change only, with no functionality change. BUG=angleproject:747 Change-Id: I7860cc4b6260b6c22faa5f2885297333c0cdb4ed Reviewed-on: https://chromium-review.googlesource.com/483426 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 876429b7 2017-04-20T15:46:24 Update gl2.h and update entry points. Some method signatures were updated. Types like GLclampf and GLvoid were replaced with other equivalents. BUG=angleproject:1309 Change-Id: I05e8e2072c5a063d87ad96a855b907424661e680 Reviewed-on: https://chromium-review.googlesource.com/475011 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 9c9b40ac 2017-04-26T16:31:57 Use parameter cache to skip passing IndexRange. For DrawElements et al., we can use a simple design to store entry point parameters and compute index ranges lazily. This allows us to compute the index range outside of the validation layer. Fixing this will let us implement a few things, such as the no error extension. It will also allow auto-generation of the entry points, since we won't have to have special cases for certain entry points. It will also help fix the syncState layering problem. Now the cached parameter helper (which is owned by the Context) can make the impl layer calls, instead of the validation layer calling the impl directly. We use a small array in Context to gather parameters in a generic way without reallocation on call. We also check type safety by storing a type info struct which can handle inheritance between type classes. Optional variables for the cache determine when to re-compute values. The intent with gatherParams is to call this in every entry point, and have in most cases be a no-op. In some cases like for IndexRange, we store some parameters for later use. The inheritance scheme enables auto-generation of the entry points by keeping signatures similar. BUG=angleproject:747 Change-Id: I871e99e1334cf6e61ef8da62fde3ced094903f8a Reviewed-on: https://chromium-review.googlesource.com/474119 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yunchao He d7297bfb 2017-04-19T15:27:10 Code refactoring: replace NULL by nullptr for pointers. This is the frist change to replace NULL by nullptr. It handles the initialization and assignment for pointers. BUG=angleproject:2001 Change-Id: I6d4bb198a72e38b867cd2f65a6e6f2f61339a0b5 Reviewed-on: https://chromium-review.googlesource.com/481600 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang ca27139e 2017-04-05T12:30:00 Key the format tables on internal format and type. Keying the format tables on internal format alone is not enough to fully validate the unsized formats which require additional type information. This CL has no functional changes, it just splits the tables and updates the calls to GetInternalFormat info to provide type information when the format is not sized. BUG=angleproject:1523 BUG=angleproject:1958 BUG=angleproject:1228 Change-Id: I37e5201e7f54fa8eca01b8a6e64b11a6b94484e7 Reviewed-on: https://chromium-review.googlesource.com/468449 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c1d770e8 2017-04-13T17:31:24 Refactor remaining GLES 2.0 entry points. This will pave the way for several features, like auto-generation. BUG=angleproject:747 Change-Id: Ic390ac412f4e6b61346629093f185a4c07ea0284 Reviewed-on: https://chromium-review.googlesource.com/474118 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 6e60d6bf 2017-04-12T12:59:04 Don't allow deleting the 0 transform feedback. BUG=709786 Change-Id: I956cae994241a650869cee45c471074d08e79a5d Reviewed-on: https://chromium-review.googlesource.com/475131 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Xinghua Cao 2b39659d 2017-03-29T15:36:04 ES31: Implement glDispatchCompute for OpenGL backend This patch refers to https://chromium-review.googlesource.com/c/380639/ BUG=angleproject:1955 TESTCASE=angle_end2end_tests Change-Id: Iafd7a6ba2d71c0b332d9267a1260d9dbd9800c02 Reviewed-on: https://chromium-review.googlesource.com/462089 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Yunchao He <yunchao.he@intel.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 82483b93 2017-04-11T15:33:00 Obey the bufSize and write to the length parameter in glGetSynciv. BUG=angleproject:1985 TEST=conformance2/state/gl-object-get-calls Change-Id: Ic83c408b60d394ff5719beaedc5d4721b7811a47 Reviewed-on: https://chromium-review.googlesource.com/474551 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>