src/libANGLE/Shader.cpp


Log

Author Commit Date CI Message
Yuly Novikov f64f9546 2021-12-07T20:17:32 Reland "Decouple gl_BaseVertex/gl_BaseInstance uniforms" This reverts commit 10e5f34d1439f0bcd5b30bea5bfbf6bdaafd4935. Reason for revert: exonerated from flaky crash suspect Original change's description: > Revert "Decouple gl_BaseVertex/gl_BaseInstance uniforms" > > This reverts commit 36bf1ebe5e9500704dd235254bd22a1f2bbd7059. > > Reason for revert: suspect causing flaky crashes > > Bug: angleproject:6763 > > Original change's description: > > Decouple gl_BaseVertex/gl_BaseInstance uniforms > > > > These are builtin uniforms removed in > > https://github.com/KhronosGroup/WebGL/pull/3278 > > > > Decouple them from the original ANGLE_base_vertex_base_instance > > extension. > > > > Make a new ANGLE_base_vertex_base_instance_shader_builtin > > extension for these builtin uniforms. > > > > Bug: angleproject:3402 > > Change-Id: I77b93917976ce435db9c578c0ade37bff18a42b0 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3290304 > > Commit-Queue: Shrek Shao <shrekshao@google.com> > > Reviewed-by: Geoff Lang <geofflang@chromium.org> > > Reviewed-by: Kenneth Russell <kbr@chromium.org> > > Bug: angleproject:3402 > Change-Id: I75830baa14cf4e7c53750fd14ff76501145b4823 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3315610 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Reviewed-by: Yuly Novikov <ynovikov@chromium.org> > Reviewed-by: Kenneth Russell <kbr@chromium.org> > Commit-Queue: Shrek Shao <shrekshao@google.com> Bug: angleproject:6763 Bug: angleproject:3402 Change-Id: Ie436dc5d55364e464897d407a53b793941cd5d0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3321703 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shrek Shao 10e5f34d 2021-12-04T00:10:21 Revert "Decouple gl_BaseVertex/gl_BaseInstance uniforms" This reverts commit 36bf1ebe5e9500704dd235254bd22a1f2bbd7059. Reason for revert: suspect causing flaky crashes Bug: angleproject:6763 Original change's description: > Decouple gl_BaseVertex/gl_BaseInstance uniforms > > These are builtin uniforms removed in > https://github.com/KhronosGroup/WebGL/pull/3278 > > Decouple them from the original ANGLE_base_vertex_base_instance > extension. > > Make a new ANGLE_base_vertex_base_instance_shader_builtin > extension for these builtin uniforms. > > Bug: angleproject:3402 > Change-Id: I77b93917976ce435db9c578c0ade37bff18a42b0 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3290304 > Commit-Queue: Shrek Shao <shrekshao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Kenneth Russell <kbr@chromium.org> Bug: angleproject:3402 Change-Id: I75830baa14cf4e7c53750fd14ff76501145b4823 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3315610 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
Shrek Shao 36bf1ebe 2021-11-17T13:31:17 Decouple gl_BaseVertex/gl_BaseInstance uniforms These are builtin uniforms removed in https://github.com/KhronosGroup/WebGL/pull/3278 Decouple them from the original ANGLE_base_vertex_base_instance extension. Make a new ANGLE_base_vertex_base_instance_shader_builtin extension for these builtin uniforms. Bug: angleproject:3402 Change-Id: I77b93917976ce435db9c578c0ade37bff18a42b0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3290304 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Jamie Madill 1ca1589f 2021-09-13T10:56:58 Give GLES extension bools a vendor suffix. This is in preparation for auto-generation which will give all of these bools suffixes. Bug: angleproject:6379 Change-Id: I7e3f6c9b644c41a2165e6bf7b62d661fd352a250 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3158503 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill b6e99bb3 2021-09-02T13:47:34 Rename and expand shader variable init feature. This feature now forces both output and unitialized locals to be initialized by the shader translator. This feature is needed by the trace validator to ensure we get deterministic behaviour in traces that exhibit some undefined results. Bug: angleproject:5133 Change-Id: Id1242cd077a57e891eed217f7671976ce1631a58 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140216 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2f45d93d 2021-08-18T16:58:44 Capture/Replay: Init shader outputs during self-tests. This forces all uninitialized variables to have default values. For instance if the application doesn't initialize the output color, or a varying that's use in the output, this will ensure we don't use any undefined values in the computation. Found when working on a re-trace of T-Rex, which doesn't write to the alpha channel in the final rendering pass. Also fixes undefined values in GLSLTest.InactiveVaryingInVertexActiveInFragment. Bug: angleproject:5133 Change-Id: Ia291338e5adf23dab5263cb2ebe737dc05852d3e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3110225 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 776c6015 2021-02-26T00:00:57 Vulkan: Call glslang at compile time With this change, the ANGLE translator immediately compiles the generated GLSL into SPIR-V with glslang and discards the source. This is in preparation for generating SPIR-V directly, by making the frontend and backend already able to digest it. This change also allows the expensive glslang calls to be parallelized, improving the following perf test by about 20%: LinkProgramBenchmark.Run/vulkan_compile_and_link_multi_thread Previously, the test was run as such in the Vulkan backend: Main Thread 1 Thread 2 Compile1 ---> Compile2 ---------------------> Translator Translator <--- <--------------------- Link glslang for shader1 glslang for shader2 Done With this change, it is run as such: Main Thread 1 Thread 2 Compile1 ---> Compile2 ---------------------> Translator Translator glslang glslang <--- <--------------------- Link Done glslang_wrapper_utils no longer interacts with glslang! A rename will follow. Bug: angleproject:4889 Change-Id: If4303e8ba0ba43b1a2f47f8c0a9133d0bee1a19a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2721195 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi bb3adfa4 2020-12-01T15:43:13 Rename ShaderVariable::structName to structOrBlockName Bug: angleproject:3580 Change-Id: Ic53a5267972f153dad2e20948e493e9767a45d16 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2568247 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b912eec5 2020-11-27T11:08:41 Vulkan: Support GL_EXT_tessellation_shader. Shader translator changes done in http://crrev.com/c/2633936 Adds a new DIRTY_BIT_PATCH_VERTICES state to Context. Supportes state query and transform feedback. 4 test suppressions remain as follow-up fixes. Adds a new varying packing mode for a simple Vulkan rule set. Based on work by Mohan Maiya (m.maiya@samsung.com). Test: dEQP-GLES31.functional.tessellation.* Bug: angleproject:3572 Change-Id: I4cad2cca30adb754fd12c83027673906541f566a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2568234 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 8065aa82 2020-12-22T23:38:42 Front-end support for xfb capture of I/O block members Validation and generation of transform feedback varyings that specify an I/O block member are implemented in this change. The GL backend is able to pass the added tests. Bug: angleproject:3606 Change-Id: I66d02bed8ca9161555d0d1e7a32ae9ef4d9e813f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2599952 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Charlie Lao 24f64249 2020-11-16T17:55:02 Vulkan: Track specialization constant usage bit and feedback to ctx Right now context does not know which specialization constant is used by the shader. Whenever a specialization constant changes, we assume shader program is using it, we always reach into vulkan driver to ask for a new program. Instead we can track shader's usage of specialization constant so that context can utilize this information to avoid recompile pipeline program if an unused specialization constant has changed. This CL implements the plumbing the usage bits form compiler to program object, it does not actually utilize the usage bits to avoid unnecessary compilation yet. Bug: b/173461931 Change-Id: Iebc9d0638c17b1a282c8b6093ce6bae154246e57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2542866 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Jamie Madill a8d4457c 2020-10-02T23:51:57 Change shader compile failures into an info message. This reduces spam in our unit tests. Speeds up test execution. Bug: angleproject:3162 Change-Id: I286a18b3ce862c4e4155076b2ee3f93c9db2eb33 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2447041 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 7a0faa82 2020-09-24T20:15:26 Revert "Pass #pragma optimize setting down to compilation." This reverts commit 499173de1c91932ba272269cab6918bf7e8d7c11. Reason for revert: Causes unexpected HLSL compiler errors in some cases. See bug. Bug: angleproject:5094 Original change's description: > Pass #pragma optimize setting down to compilation. > > This will allow us to disable optimizations in the back-end. This can > be useful both for developers and for ANGLE to disable very slow > shader compilation on D3D11. > > Also apply this pragma to VerifyMaxVertexUniformVectorsWithSamplers. > Reduces compilation time by half in local testing. > > Bug: angleproject:5076 > Change-Id: I64ad576e11b9cee5b41f8af0d3621570304d65c2 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2420749 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jonahr@google.com,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:5076 Change-Id: I733e788fe8e9421ae0af662c0eb51af1ed79dde3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2429517 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 499173de 2020-09-20T10:42:56 Pass #pragma optimize setting down to compilation. This will allow us to disable optimizations in the back-end. This can be useful both for developers and for ANGLE to disable very slow shader compilation on D3D11. Also apply this pragma to VerifyMaxVertexUniformVectorsWithSamplers. Reduces compilation time by half in local testing. Bug: angleproject:5076 Change-Id: I64ad576e11b9cee5b41f8af0d3621570304d65c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2420749 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Philip Lamoureux 9515707b 2020-05-29T11:23:44 Move ShaderVariable utility function from utilities.cpp ShaderVars.cpp. Fixes an implied dependency cycle between translator and angle_common. This will also allow us to be more strict about declaring dependencies on GLSLANG headers. Tested by building and running angle_unit_tests on Linux. Bug: angleproject:4672 Change-Id: I331230d2cf179ccea140ee7a0d5a3c8768c58cb1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2222682 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao dee4d7a5 2020-04-10T10:22:56 Vulkan: Early fragment tests optimization Checks if early fragment tests as an optimization is feasible and enable it if we can. In the link time, if context state diagrees with optimization (in rare case), then remove the ExecutionModeEarlyFragmentTests sprv op code. Bug: angleproject:4508 Change-Id: Ifbb06c0ffb050a9f3ddb16ab50362e908b4b9cf6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2136490 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Courtney Goeltzenleuchter 33a00efd 2019-11-27T09:21:45 Add Compute Shared Memory Size Validation Add tracking of shared memory declarations in compute shaders. Test:   angle_deqp_gles31_tests --gtest_filter=dEQP.GLES31/functional_debug_negative_coverage_callbacks_compute_exceed_shared_memory_size_limit Bug: 4173 Change-Id: If2a86d467a82f73fa5b2ee0ced752701acfe1872 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1934653 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinyi He 4c7db77e 2019-10-31T15:42:31 Vulkan: Set limitation on maxComputeWorkGroupCount According to Table 20.45 and Chapter 17 in the ES 3.1 spec, MAX_COMPUTE_WORK_GROUP_COUNT is get as a GLint by using GetIntegeri_v. However, it is an unsigned integer in the Vulkan. It needs to set limitation on maxComputeWorkGroupCount[] during translating. 1. Change the data type to GLint stored in Caps. 2. Ensure that the limitation is set during initialization. 3. Add workaround for angleproject:4120 Bug: angleproject:4066 Change-Id: I1659ba1d560e30b9599cace0feeab8a18890c3ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1890586 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten c5c096aa 2019-11-15T15:36:16 Enable Compute Shader Program Input Queries Compute shader inputs were not being tracked in the Shader or Program states, causing program interface queries to fail. This change treats compute shader inputs (all built-ins) as Attributes and pipes them through from the Compiler to the Program to enable input queries. While compute shader inputs are not technically attributes (or varyings), the ANGLE code understands and handles attributes and a program can never have both a vertex and compute shader, so there can't be any conflicts. The naming of these variable lists should probabaly be revisited at some point to better handle these different use-cases. Bug: angleproject:3596 Test: dEQP-GLES31.functional.program_interface_query.program_input.resource_list.compute.empty Change-Id: Ie52cd59041868cfdb5d3d759bb4ec53c8d5b38d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1919557 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Jaedon Lee a0159c03 2019-09-02T14:49:07 Vulkan: Implement basic geometry shader feature Enable the default behavior of the geometry shader Bug: angleproject:3571 Test: dEQP-GLES31.functional.geometry_shading.input.basic_primitive.points dEQP-GLES31.functional.geometry_shading.input.basic_primitive.lines dEQP-GLES31.functional.geometry_shading.input.basic_primitive.line_loop dEQP-GLES31.functional.geometry_shading.input.basic_primitive.line_strip dEQP-GLES31.functional.geometry_shading.input.basic_primitive.triangles dEQP-GLES31.functional.geometry_shading.input.basic_primitive.triangle_strip dEQP-GLES31.functional.geometry_shading.input.basic_primitive.triangle_fan Change-Id: I65708d19bbfe6a0ad8ca392a1d6b3609b1410ef4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1793753 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 90a58622 2019-09-04T15:39:58 Refactor ShaderVariable to Remove Specializations The following structs are being refactored and moved into the parent struct ShaderVariable: VariableWithLocation Uniform Attribute OutputVariable InterfaceBlockField Varying Bug: angleproject:3899 Test: CQ Change-Id: I389eb3ab4ed44a360e09fca75ecc78d64a277f83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785877 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Jiacheng Lu 120b61d3 2019-08-21T12:51:58 Use ShaderProgramID in place of GLuint handles Bug: angleproject:3804 Change-Id: I5dc640004c2cc054c53261e8e939b6a9f5fc23bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762363 Commit-Queue: Jiacheng Lu <lujc@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Tim Van Patten 5d27a696 2019-08-13T11:29:07 Support separable shader programs The spec states: Shader stages including vertex shaders, fragment shaders, and compute shaders...A single program object can contain all of these shaders, or any subset thereof. This change allows shader programs without a fragment shader. The biggest driver of this change is dEQP since a large number of tests create shader programs without a fragment shader. Bug: angleproject:3803 Test: dEQP-GLES31.functional.program_interface_query Change-Id: Id6cb098c62a1489a14b9ec1b31bd4cd59f655e49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1752010 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
shrekshao cd31f286 2019-06-25T14:22:41 Implement Draw base vertex and base instance functions This patch implements functionality of glDrawArraysInstancedBaseInstanceANGLE, glDrawElementsInstancedBaseVertexBaseInstanceANGLE, glMultiDrawArraysInstancedBaseInstanceANGLE, and glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE Workaround for OpenGL driver on Mac: gl_VertexID on Mac with AMD GPU doesn't include baseVertex value. So replace gl_VertexID with (gl_VertexID + angle_BaseVertex) if any. Workaround for Vulkan GLSL: gl_InstanceIndex on Vulkan includes baseInstance. So replace gl_InstanceIndex with (gl_InstanceIndex - angle_BaseInstance) when angle_BaseInstance is declared. Bug: chromium:891861, angleproject:3402 Change-Id: Ia1d94b5d4d7da7e635468c05c962c4f7eb1b1919 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750126 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
James Dong 1d5aaa6c 2019-08-06T11:20:13 Vulkan: support dynamic indices in array of arrays Expands existing struct-sampler rewrite to flatten arrays of arrays. This allows us to support dynamically-uniform array indexing, which is core in ES 3.2. Samplers inside (possibly nested) structs are broken apart as before, and then if the type resulting from merging the array sizes of the field and its containing structs is an array of array, the array is flattened. Also adds an offset parameter to functions taking in arrays to account for this translation. As a result of outer array sizes leaking into function signatures, functions taking arrays of different sizes are duplicated according to how the function is invoked. Bug: angleproject:3604 Change-Id: Ic9373fd12a38f19bd811eac92e281055a63c1901 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1744177 Commit-Queue: James Dong <dongja@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang bce4b9f8 2019-06-19T16:20:09 Always scalarize mat and vec constructor arguments. This workaround is always enabled in Chrome, do the same in ANGLE. BUG=882580 Change-Id: I2c01f34a589b07bd0035d7408be884f7a51b1706 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1666699 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 051b0896 2019-04-15T15:39:39 Vulkan: Fix layout substitution for struct varyings If the shader contains code such as the following: struct S { vec4 field; }; out S varStruct; The layout qualifier macro is defined as @@ LAYOUT-varStruct @@. However, the Vulkan backend was replacing @@ LAYOUT-field @@. Bug: angleproject:3220 Change-Id: Iae15003867e0bed2cc939159a6653429c7a431e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1571389 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
jchen10 7d53c60b 2019-02-15T21:06:42 ParallelCompile: use the native extensions This enhances to use the native parallel compile extensions if available. Bug: 873724 Change-Id: I0aaed314accd75e1bfa596b322225b56d729d3a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1475234 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 aead8edf 2019-02-13T13:55:09 Mute worker context creation warnings This moves the warnings to InfoLog. Bug: chromium:931294 Change-Id: I1627aa63bdda6f92fc89b8921eb260302ba9063f Reviewed-on: https://chromium-review.googlesource.com/c/1469721 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
jchen10 a100d8f4 2018-12-29T16:39:55 ParallelCompile: add GL backend support For GL backend, at first each worker thread must have a naitve context for its own to work in. These worker contexts have to be shared from the main context, so that all shader and program objects are seen in any context. This extends backend displays to create and destroy the worker contexts. RendererGL manages and allocates them to the worker threads. ShaderImpl has a new compile method added to do the actual glCompile work in worker thread. The ProgramGL's link method is broken down by introducing the LinkEventGL class. Bug: chromium:849576 Change-Id: Idc2c51b4b6c978781ae77810e62c480acc67ebb5 Reviewed-on: https://chromium-review.googlesource.com/c/1373015 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e90d4ee9 2018-11-28T14:04:00 Pass Context to setLabel. This is useful for triggering a dirty state notification for Textures. It will lead to improvements for program and texture dirty bits. Bug: angleproject:2966 Change-Id: Iaba625da8a970a558f7d158bfa2f09c964f6761a Reviewed-on: https://chromium-review.googlesource.com/c/1347669 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
jchen10 cd47a379 2018-11-11T11:08:16 Add SH_INIT_SHARED_VARIABLES flag This option is used to initialize shared variables to zero at the beginning of shader execution to avoid compute shaders being able to read undefined values that could be coming from another webpage or application. It's implemented by declaring variables with initial value for HLSL. For GLSL, it's not allowed to use declaraction initializer for shared variables, so we need to explicitly assign them to zero at the beginning of main(). This implementation is only for HLSL. Bug: chromium:898030 Change-Id: Ic5906500bf4a35cd9a071923f82f32c5e2991be3 Reviewed-on: https://chromium-review.googlesource.com/c/1330310 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@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>
jchen10 a155bacf 2018-08-16T15:26:39 ParallelCompile: Parallelize shader translation This changes to construct a new ShHandle of compiler for each Shader, and use it to translate the shader source in a background thread. Bug: chromium:849576 Change-Id: Ib49952c7292321ee6aa1c5996f8f7927f40d8f04 Reviewed-on: https://chromium-review.googlesource.com/1177195 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 3fd614d0 2018-08-13T12:21:58 Refactor Context dependency for resolveCompile The context parameter of Shader::resolveCompile method causes a bad impact that many methods in Shader, Program etc. have to have a same context parameter. By removing it, these methods can be decoupled from Context. BUG=chromium:849576 Change-Id: Ia5545ee9dce45794550f6086bc0e6c4707e1276e Reviewed-on: https://chromium-review.googlesource.com/1172202 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 77a2b4c3 2018-05-21T17:28:29 Validate the total invocations within a work group If the total number of invocations within a work group is greater than MAX_COMPUTE_WORK_GROUP_INVOCATIONS, a compile-time error will occur. BUG=angleproject:2572 TEST=dEQP.GLES31/functional_debug_negative_coverage_callbacks_compute_invalid_maximum_work_group_sizes dEQP.GLES31/functional_debug_negative_coverage_log_compute_invalid_maximum_work_group_sizes dEQP.GLES31/functional_debug_negative_coverage_get_error_compute_invalid_maximum_work_group_sizes Change-Id: I8218b618d1b347df2c85cfc67ba82ae91d756e05 Reviewed-on: https://chromium-review.googlesource.com/1066076 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 493f9571 2018-05-24T19:52:15 Add PrimitiveMode packed GLenum. Bug: angleproject:2574 Change-Id: I3d7bd7ca0d69a364a611dc04799ea34906fc4a6c Reviewed-on: https://chromium-review.googlesource.com/1067114 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 58662082 2018-05-10T13:41:51 Pass a gl::Context to ShaderImpl methods. Also add a destroy method. BUG=angleproject:2464 Change-Id: I7346b799af4e7d64ed5cc3d5eca8e108ce2cf699 Reviewed-on: https://chromium-review.googlesource.com/1054213 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho ebd6e2df 2018-03-23T17:07:55 Take all attributes into account when checking for aliasing This makes ANGLE to follow GLSL ES 3.00.6 spec section 12.46. The spec requires that all attributes are taken into account when checking for aliasing, regardless of if they are active or not. WebGL 2.0 spec was also recently changed to reflect GLSL ES 3.00.6 correctly. Aliasing checks for GLSL ES 1.00 shaders are left as-is. BUG=chromium:829541 TEST=angle_end2end_tests, WebGL conformance tests Change-Id: I71c36ac123f18dadf075e81f93af29321c15136b Reviewed-on: https://chromium-review.googlesource.com/1005077 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jiawei Shao 385b3e03 2018-03-21T09:43:28 Use packed enums on shader types in ANGLE renderer This patch uses a packed internal enum ShaderType everywhere we need a shader type instead of the GLenum value of the shader type. This patch also uses program::getAttachedShader(type) everywhere we need to get gl::Shader from a program in ANGLE. BUG=angleproject:2169 Change-Id: I28a7fa1cfe35622c57a486932911110688eaadec Reviewed-on: https://chromium-review.googlesource.com/972844 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 107c7247 2018-03-20T15:45:35 ShaderVariable: separate fields for staticUse and active Thus far the compiler has used the "staticUse" flag to mark variables that should have rather been marked "active", meaning that the code may actually execute in a way that accesses the variable. There's a clear definition for this use of the term "active" in the GLES 3.0.5 spec, section 2.12.6, and in GLES 3.1 section 7.3.1. Having separate fields for recording static use and "activeness" of a variable is the first step to fixing this. According to the spec, usually only active resources should be considered when checking use against max limits. Also, only active uniforms get assigned a location. libANGLE code now correctly checks the active flag rather than the static use flag in these cases. The static use field still mirrors the active field for now, since some code in Chromium also needs to be fixed to use the active field correctly before the two can diverge. After Chromium is fixed, we can fix ANGLE so that static use information is recorded earlier during compilation and will accurately reflect whether variables are statically used. Currently the compiler only records variables once some static use may already have been pruned from the AST. BUG=angleproject:2262 TEST=angle_unittests, angle_end2end_tests Change-Id: I025bb71361246ae00c911a1f8b66ec045f665f29 Reviewed-on: https://chromium-review.googlesource.com/970962 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jiawei Shao 4ed05da2 2018-02-02T14:26:15 ES31: Add link validation on geometry shader itself This patch intends to support program link validation on geometry shader itself. A link error should occur when linking a program with a geometry shader that lacks input primitive or output primitive or the declaration of 'max_vertices'. This patch also adds the support of linking a program with geometry shader in angle_end2end_tests. BUG=angleproject:1941 TEST=angle_end2end_tests dEQP-GLES31.functional.shaders.linkage.es31.geometry.varying.rules.unspecified_* Change-Id: I25fb08514753102f5dd3ab86211c05d2ca4fd185 Reviewed-on: https://chromium-review.googlesource.com/898842 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiawei Shao 881b7bfa 2017-12-25T11:18:37 ES31: Refactor link mismatch error log This patch intends to refactor the structure of logging link mismatch errors to meet the new GLES 3.1 program link requirements and support linking program with geometry shader. This patch is mainly focusing on the following 4 issues: 1. There are totally 14 places that log the link mismatch errors in almost same format. 2. A temporary string is created (STRUCT_NAME.FIELD_NAME) before checking a field of a block, which is of no use if link succeeds. 3. LinkValidateVariablesBase needs to know "shaderTypes" if we support geometry shader based on current structure. Since uniforms are checked in the range of the whole program, it is unnecessary to know in which shader a uniform is defined if link succeeds. 4. GLES 3.1 regards varyings with same location but different names as matched, so it isn't enough to log errors only by one name. This patch can solve all these issues by the following 3 changes: 1. Replace "infoLog" and "variableNames" by "mismatchedFieldName" (the complete field name if the mismatch occurs on a field of a struct or block). 2. Use enum LinkMismatchError as the return value of all linkValidate* functions to reflect the detail of the link mismatch error. 3. Log all the link mismatch errors by InfoLog::logLinkMismatch where we can get shader types instead of passing them into linkValidate* functions. BUG=angleproject:1941, angleproject:2144 TEST=angle_end2end_tests Change-Id: I3ed876d61f812cc7a45a6a3c5fec0b4a88b9cc2c Reviewed-on: https://chromium-review.googlesource.com/844215 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
jchen10 8225e73b 2017-11-14T16:29:03 Support struct varying for transform feedback Capturing struct members is vague In ES 3.00. But the ES 3.10 explicitly says that base-level members of struct are feasible for transform feedback capture. This implementation fills the gap. TEST=angle_end2end_tests:TrasnformFeedbackTest* BUG=angleproject:2241 Change-Id: Ibdf3ae6c2b8b28952e2f7fef1363545cbccad389 Reviewed-on: https://chromium-review.googlesource.com/768613 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 465835d6 2017-09-26T13:34:10 Support arrays of arrays in the API The ShaderVariable class that is used as an interface between the compiler and the rest of the code gets arrays of arrays support. Array of array variables are passed from the compiler just like any other variables. However, when stored in Program state each innermost array constitutes a separate variable. This is done to make the implementation match the GLES specification for program interface query APIs. This will be tested more fully once support for parsing arrays of arrays lands in the compiler. TEST=angle_end2end_tests, angle_unittests BUG=angleproject:2125 Change-Id: I0f7159000f039be92a87a52b3b68cd9a215a21cb Reviewed-on: https://chromium-review.googlesource.com/684742 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> 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>
Jiawei Shao 3d40488b 2017-10-16T13:30:48 Split varyings into input and output varyings in renderer This patch intends to split all vector<Varying> into two vectors to store input and output varyings separately in the renderer. This patch is a base of supporting program linking with geometry shader. Unlike the vertex shaders (their outputs are varyings) and fragment shaders (their inputs are varyings), the inputs and outputs of geometry shaders are all varyings, so we need two vector<Varying> to store them correctly. BUG=angleproject:1941 TEST=angle_end2end_tests Change-Id: Ic4b8343f2fc3df87b764c45f2ea7810e565f7bee Reviewed-on: https://chromium-review.googlesource.com/720617 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill f00f7ffe 2017-08-31T14:39:15 Add a Uniform type info table. Currently most uniform type info is determined by switching on the uniform type. Some values are computed from other values, which can result in three or more switch statements plus some multiplies or other math. This patch attempts to improve the speed by pre computing necessary values into constant static tables. Improves performance by about 7% in a uniform stress test. BUG=angleproject:1390 Change-Id: I29bef259a17f6d6536171ade4950e2d712bfd39c Reviewed-on: https://chromium-review.googlesource.com/643791 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 855d964b 2017-05-17T14:05:06 Prefix user-defined names in GLSL output Now user-defined names are prefixed by _u in GLSL output in case name hashing is not on. Internal names such as names of temporary variables created in AST transformations are written out as such. This makes handling of internal function names and internal variable names consistent. It also removes the possibility of name conflicts between user-defined names and internal names in case name hashing is not on. In the same vein, it makes it safe to use GLSL reserved words that are not reserved in ESSL as variable names in case name hashing is not on. This also makes the GLSL output more consistent with how names are handled in HLSL output. Name hashing code is shared between VariableInfo and OutputGLSLBase to ensure names are handled consistently in both. The name that's used in the shader source for a given interface variable is written out to ShaderVariable::mappedName. An exception needs to be made for identifiers close to the length limit, since adding any prefix would take them over the limit. But they can be just written out as such, since we don't have any builtins or ANGLE internal variables that have as long names and could create a conflict. BUG=angleproject:2139 BUG=angleproject:2038 TEST=angle_unittests, angle_end2end_tests, WebGL conformance tests Change-Id: Id6ed052c4fab2d091227dc9a3668083053b67a38 Reviewed-on: https://chromium-review.googlesource.com/507647 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiajia Qin 9b11ea4f 2017-07-11T16:50:08 Gather UniformBlock and ShaderStorageBlock separately Refactor InterfaceBlocks since it only stands for UniformBlock before ES31. But for ES31, uniform block and shader storage block both belong to interface block. This CL will add GetUniformBlocks and GetShaderStorageBlocks in ShaderLang.h. Meanwhile, keep GetInterfaceBlocks which can return all the interface blocks together. BUG=angleproject:1951 Change-Id: I3036e201aadfbd490575ed03538c81bcc3793ff3 Reviewed-on: https://chromium-review.googlesource.com/582546 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Martin Radev 7cf6166a 2017-07-26T17:10:53 Generate error on program-framebuffer num views mismatch According to the ANGLE_multiview spec Draw* commands should generate an INVALID_OPERATION error if the program uses the multiview extension and the number of views in the active draw framebuffer and active program differs. The patch addresses this by extending the base draw call validation. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I369070beb5ccb17211dbe61ebec40bfcbcf5bc4e Reviewed-on: https://chromium-review.googlesource.com/586605 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang ab4be84f 2017-07-18T11:23:07 Add newlines when writing original shader source to shader debug output. Previously, the entire original shader would end up being written to a single line, not very readable. Change-Id: I8cdfd498bb47395da2bd11c3d3b2eecf266c914e Reviewed-on: https://chromium-review.googlesource.com/576064 Reviewed-by: Corentin Wallez <cwallez@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 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 34ca4f5b 2017-06-13T11:49:39 Remove Shader::getSemanticIndex. This method doesn't really belong to GL, and was only used by the D3D back-end to compute some attribute indexes. Simplify the code by moving it into ProgramD3D. Also add the ability for the ShaderImpl to assert that any pending compiles have resolved. BUG=angleproject:1156 Change-Id: I0af3d3082ff8c908e6a87b9734989efbefd28808 Reviewed-on: https://chromium-review.googlesource.com/526336 Commit-Queue: Jamie Madill <jmadill@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>
Geoff Lang 9e1bf10b 2017-03-28T15:10:48 Strip null characters from the shader source when building translated source. Some shaders had trailing null characters that caused the resulting translated source string to not output correctly. BUG=angleproject:1144 Change-Id: I7cd725ee54c9e934fd3cc511de9c2a3c34ac3eec Reviewed-on: https://chromium-review.googlesource.com/461272 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 6c1f671b 2017-02-14T19:08:04 Add destroy hooks for several GL objects. These hooks allow the back-end renderer to free object resources without having to store pointers to shared device handles for each and every object. This will allow us to save memory on back-ends that really care about memory overhead. There is a downside in that there is more boilerplate in passing gl::Context handles around everywhere. BUG=angleproject:1684 Change-Id: I89463bba8d23f92920e8956650cb73c7fc6d66b7 Reviewed-on: https://chromium-review.googlesource.com/426401 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Frank Henigman 875bbba0 2017-02-08T16:38:17 Zero gl_Position in WebGL mode. Set the SH_INIT_GL_POSITION bit in WebGL compatibility mode so gl_Position gets zeroed out. Add corresponding test. BUG=angleproject:1825 Change-Id: I47107804abaa83d6aee5cd46e6b69b532c08e6e8 Reviewed-on: https://chromium-review.googlesource.com/439784 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Geoff Lang 4ddf5afb 2016-12-01T14:30:44 Refactor ResourceManager into separate managers per resource type. BUG=angleproject:1639 Change-Id: I943f553cfb0e0feb57953770784b48e22fccc875 Reviewed-on: https://chromium-review.googlesource.com/423172 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yuly Novikov d73f852f 2017-01-13T17:48:57 Reland "Replace gl::trace logging with Chromium style logging" Removing one usage of FormatString() and its static buffer. And preparation for Platform logging. Fix incorrect enabling of ERR() calls in UNIMPLEMENTED() and UNREACHABLE(), resulting in increased code size and <iostream> adding 5 static initializers to chrome because of cerr referenced in statically linked translator. BUG=angleproject:1660 Change-Id: I7caa18036118d532e0544f75278602559172ae04 Reviewed-on: https://chromium-review.googlesource.com/431457 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6a6b09c9 2017-01-12T21:52:29 Revert "Replace gl::trace logging with Chromium style logging" Failing Chromium static initializers check: FAILED linux-release-64/sizes/chrome-si/initializers: actual 8, expected 7, better lower Possibly due to the static initializer for std::array for the log severity types. We should change it to POD. BUG=angleproject:1660 This reverts commit afcc41cee4ff63e7f6c9e60e55fc061adbba7dd4. Change-Id: Ifb362a4af78542608397c7a0b19e6afe076f2cf3 Reviewed-on: https://chromium-review.googlesource.com/427235 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov afcc41ce 2016-12-13T12:59:39 Replace gl::trace logging with Chromium style logging Removing one usage of FormatString() and its static buffer. And preparation for Platform logging. BUG=angleproject:1660 Change-Id: I58192988ad16196706fe48d0c0ab0fd1a10c0210 Reviewed-on: https://chromium-review.googlesource.com/424173 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Bryan Bernhart 619c833b 2016-11-09T11:11:41 Add default compiler options to WebGL shaders. Enforces default compiler options when compiling WebGL compatible shaders. BUG=angleproject:1616 Change-Id: I18490db68b29981fab4817bdd61727752cf50997 Reviewed-on: https://chromium-review.googlesource.com/409016 Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill acb4b81a 2016-11-07T13:50:29 translator: Put ShaderLang APIs in "sh" namespace. Working with glslang in Vulkan means we are static linking libANGLE with functions that have the same name as our translator APIs. We can fix this by scoping our APIs. We don't need to scope the types of the file, since they don't conflict. This will require a follow-up patch to remove the unscoped APIs once we switch over Chromium. We also scope TCompiler and some related classes to avoid multiply defined link errors with glslang. BUG=angleproject:1576 Change-Id: I729b19467d2ff7d374a82044b16dbebdf2dc8f16 Reviewed-on: https://chromium-review.googlesource.com/408337 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Qiankun Miao 7ebb97fc 2016-09-08T18:01:50 Use 64-bits compile options BUG=chromium:645071 Change-Id: I31825123bf4cb45fb37a93f538e8936487beb5ff Reviewed-on: https://chromium-review.googlesource.com/382712 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Martin Radev 4c4c8e72 2016-08-04T12:25:34 Add compute program compilation and linking support Compute shaders can be now compiled and linked to create programs. Some tests are added to verify successful and unsuccessful compute shader linking. The patch also replaces std::array<int, 3> with a custom struct WorkGroupSize. BUG=angleproject:1442 TEST=angle_end2end_tests TEST=angle_unittests Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84 Reviewed-on: https://chromium-review.googlesource.com/366740 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 53ea9cc6 2016-05-17T10:12:52 Replace rx::Renderer with rx::ContextImpl. Previously Context had no Impl class, but had a special relationship with the instanced Renderer class. Having a ContextImpl backing every Context will allow new designs to enable things like multithreading (where each ContextImpl stores a Context-specific device) or non- virtual Contexts on Android or other platforms where it is more efficient. A large refactoring patch that touches every back-end. BUG=angleproject:1363 Change-Id: Icb73a7d37447f08a664eeb499a310ba05d71a57e Reviewed-on: https://chromium-review.googlesource.com/342052 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7aea7e05 2016-05-10T10:39:45 Add EGLImplFactory. Also rename ImplFactory to GLImplFactory. This will allow us to use the same factory design pattern for EGL objects, and to use State helper classes to share data with Impls. BUG=angleproject:1363 BUG=angleproject:1369 Change-Id: I07a8fe40838d5d4ca32b04910c306edeab4d25a7 Reviewed-on: https://chromium-review.googlesource.com/342051 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 15243d9b 2016-04-26T13:41:35 Rename gl::Shader::Data to gl::ShaderState. BUG=angleproject:1363 Change-Id: I49cb5d7319742487c8c00c58ec58f9a29561b9c1 Reviewed-on: https://chromium-review.googlesource.com/340743 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 70d0f499 2015-12-10T17:45:46 Implement GL_KHR_debug. BUG=angleproject:520 Change-Id: I9ced3e7ab1515feddf2ec103c26b2610a45b1784 Reviewed-on: https://chromium-review.googlesource.com/319830 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 66988745 2015-12-22T19:39:19 Revert "Implement GL_KHR_debug." This reverts commit 6c521b7a70a53b1c9f7762e53e34b5a8146b0f7b. Change-Id: I6ff981198e31f34d3e405edea6277ee75516d6ee Reviewed-on: https://chromium-review.googlesource.com/319820 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 6c521b7a 2015-12-10T17:45:46 Implement GL_KHR_debug. BUG=angleproject:520 Change-Id: I78d14cc8c94f5cef58604220f0ca847473b25bf8 Reviewed-on: https://chromium-review.googlesource.com/317820 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 847638a6 2015-11-20T13:01:41 Re-land "D3D: Generate more shader debug info by default." Re-land with fix for shader size query. The debug info can be very useful to WebGL developers. Instead of hiding the feature behind an unsupported and broken flag, always enable it so that WebGL devs can access the useful translated info. Change the debug info policy to build the full info (including generated assembly) in Debug, and all info excepth the assembly in Release. BUG=angleproject:1179 Change-Id: I812b2c9ba98cb8c9d5ec95721441c70e8990b626 Reviewed-on: https://chromium-review.googlesource.com/313600 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 55c25d0c 2015-11-18T13:08:08 D3D11: Fix varying packing with structs. Previously we would try to pass an entire struct through HLSL's shader interface. Instead, split this off as if each field was its own variable, which seems to be spec compliant (see ESSL 3.10). In the future we may want to fix register packing to use specific components of float4/int4/uint4 HLSL registers. This could also fix the remaining bugs in the SM3 packing. TEST=dEQP-GLES3.functional.shaders.linkage.varying.* BUG=angleproject:910 BUG=angleproject:1202 Change-Id: I1fd8b4505abc39bd2385ed5c088c316d55d0bc2c Reviewed-on: https://chromium-review.googlesource.com/311242 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9fc3682c 2015-11-18T13:08:07 D3D: Rework varying packing code. In D3D we pack varyings by making a register map, and using the recommended GLSL ES algorithm to reserve register space. We use this map to assign row and column slots to each varying and then produce a semantic index value. The existing scheme had a number of bugs, and was failing several angle_end2end_tests. The new design cleans up the code somewhat and uses a different counting scheme for the semantic indexes: just sort the varyings in packing order and use a simple incrementing semantic index per varying. In SM4+, the HLSL compiler sorts and packs the varyings correctly itself, and in SM3, handle the cases we don't support by returning an error instead of a D3D compiler link error. Also refactor how we store varying information for TF Feedback/ StreamOut. Only store the necessary D3D information, instead of extra information like the name and type. This fixes several tests in GLSLTest/*. This also will allow us to fix interpolation qualifier packing and the structure packing in HLSL, which seems to work differently than the rest of the varying types. BUG=angleproject:1202 TEST=bots,dEQP-GLES3.functional.transform_feedback.* Change-Id: Ie5bfbb4f71d8bf97f39115fc46d2e61b131df639 Reviewed-on: https://chromium-review.googlesource.com/311241 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill d2c52e3b 2015-10-14T17:07:05 Fix debug annotations and shaders. The Program refactor inadvertantly broken Debug annotations. Fix this by correctly passing the path to the temporary shader source in the first "C" string argument to ShCompile, instead of as the first part of the source string. BUG=angleproject:1177 TEST=manual testing with MSVS Change-Id: Ie77bb11b51645a474b542ddd2ae0f391e019e341 Reviewed-on: https://chromium-review.googlesource.com/306210 Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 006cbc5b 2015-09-23T16:47:54 Remove rx::ShaderSh and move the shared code to the GL. The GL layer can interact with the translator directly, to query all the active shader variables and call ShCompile. BUG=angleproject:1159 Change-Id: I334a9bef28f93cf85dd8cac0fb8542ac567cc3ec Reviewed-on: https://chromium-review.googlesource.com/299877 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 91445bce 2015-09-23T16:47:53 Make a shader Shader::Data state structure. This design follows the similar designs for Program, Framebuffer, etc. Because of the current design, share a mutable pointer with the Impl so the patch becomes a bit smaller and easier to review. In a follow- up patch we can move the shared code into the GL layer. BUG=angleproject:1159 Change-Id: Ib243e74779f23be51cdca80f1b5c6e5f3e36059d Reviewed-on: https://chromium-review.googlesource.com/299876 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 046e53e3 2015-09-23T16:47:52 Add an interm ShaderSh class. This class logic will eventually move to the GL layer. Keep it in the Renderer layer for now for refactoring purposes. BUG=angleproject:1159 Change-Id: I91843099367f9a0293cc43ab98626bf79eb75ebf Reviewed-on: https://chromium-review.googlesource.com/299875 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a0a9e12d 2015-09-02T15:54:30 translator: Add sh::OutputVariable type. This replaces the dual-use of sh::Attribute, which can be a bit confusing to people expecting a literal output variable. Currently not used in Chromium, so should be safe to land. BUG=angleproject:1146 Change-Id: I436f2bc9dc4ddc3709369cb2baa344c6b13a21a2 Reviewed-on: https://chromium-review.googlesource.com/296683 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4cff2477 2015-08-21T16:53:18 Make PackedVarying a D3D-only type. The register assignment stuff only applies to the D3D back-end. Cleans up the GL back-ends use of PackedVarying, and will lead to future cleanups relating to packing varyings. BUG=angleproject:1123 Change-Id: Iaaa5fc03577e5b61ea6ae76ee1e15ad608037f34 Reviewed-on: https://chromium-review.googlesource.com/295190 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 80a6fc03 2015-08-21T16:53:16 Make output variables part of Program's shared data. Also initialize this structure within Program instead of DynamicHLSL. This should have benefits for other back-ends. Also these variables weren't being serialized and de-serialized with the program binary, which could mess up WebGL apps that use MRT. BUG=angleproject:1123 Change-Id: Ic0dd4840f26441a1bee8527dfa178b24daf82f8a Reviewed-on: https://chromium-review.googlesource.com/294571 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin 4d61f7ed 2015-08-12T10:56:50 Reland Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' Additional warnings found with more testing and added C4267 warning disable only for angle_libpng BUG=angleproject:1120 Change-Id: Ic403dcff5a8018056fa51a8c408e64207f3362eb Reviewed-on: https://chromium-review.googlesource.com/293028 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b195643c 2015-08-12T17:35:20 Revert "Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'" Seems to have quite a few warnings in 64-bit on my machine. BUG=angleproject:1120 This reverts commit c5cf9bc47d0ee028adbbf9e9f94ca567eec601dc. Change-Id: I86768b900aeba52e7a2242d9ae8949f93f1a5ba9 Reviewed-on: https://chromium-review.googlesource.com/293280 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Cooper Partin c5cf9bc4 2015-08-06T10:46:48 Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data' BUG=angleproject:1120 Change-Id: I01ef10bea7f487c2b394d030c76628f38d2ea645 Reviewed-on: https://chromium-review.googlesource.com/292780 Tested-by: Cooper Partin <coopp@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez bc99bb6b 2015-05-14T17:42:20 Enable more warnings on GCC and clang BUG=angleproject:892 Change-Id: I74ca341f29b245f698d1e1ad43149a91db46817f Reviewed-on: https://chromium-review.googlesource.com/271411 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 492a7e43 2014-11-05T13:27:06 Encapulate the ESSL compiler into a GL object that is per-context. * Allows for multiple contexts have to have different client versions, caps and extensions without causing shader compilation failures. BUG=angle:823 Change-Id: I523679e90be031b0b7fa385d46d6839b1cf3029f Reviewed-on: https://chromium-review.googlesource.com/227710 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 437d2662 2014-12-05T14:23:35 Move some D3D-specific stuff into ProgramD3D. BUG=angle:773 Change-Id: I48b42e7a3e82a43d3dde16a8d1016d28280eae39 Reviewed-on: https://chromium-review.googlesource.com/232968 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e7cfb3dd 2014-12-03T10:58:56 Do not use std::strlen. GCC doesn't use the std:: namespace for these methods. BUG=angle:773 Change-Id: I0d887f103298cdd184b3f7825c5e44363edb9b92 Reviewed-on: https://chromium-review.googlesource.com/232697 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Geoff Lang f60fab6d 2014-11-24T11:21:20 Fix handling of shader source with fixed length. BUG=angle:837 Change-Id: Ie9c3059ad2973b0733be92b7548525ee694bb1fa Reviewed-on: https://chromium-review.googlesource.com/231612 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2b5420c0 2014-11-19T14:20:15 Merge libGLESv2 and libEGL classes into libANGLE. BUG=angle:733 Change-Id: Ic491c971411fe82c56cd97c5c8325ac14ec218df Reviewed-on: https://chromium-review.googlesource.com/230830 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>