src/compiler/translator/glslang_tab_autogen.cpp


Log

Author Commit Date CI Message
Kimmo Kinnunen b8b962d2 2024-11-08T14:53:00 Parse function parameters into TPublicType Parse function parameters into TPublicType instead of TType. TType holds the type info, TPublicType holds the type specification info. This helps in moving the TType::isStructSpecifier into the AST nodes, away from the type system which it is not part of. Removes duplicated code where unnamed unsized arrays would cause different error message than named unsized arrays. Bug: angleproject:377330017 Change-Id: I102b9e87823a545f7e64f971aafbdcd313a542fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6000009 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Kimmo Kinnunen 4a5b0284 2024-10-24T11:46:54 Disallow discarded uniform block references Uniform block instances cannot be used by themselves, as there is no way to refer to their type. Disallow the only typeless access pattern, discarding via expression statement: uniform MyBlock { int x; } b; void main() { b; 0, b; } Explained as disallowed in newer GLSL 300: https://github.com/KhronosGroup/WebGL/issues/3644 The comma expression form would ASSERT in CollectVariables. Bug: angleproject:42267026 Change-Id: I6c8b835482fd551bd97576c1bd24f005874da6af Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5961498 Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
ericali 016ef60d 2024-06-24T17:41:30 ValidateAST asserts when refers to builtIn struct type name Refers to build in type name looks allowed by GL but currently VK and Metal backends do not support, i.e.: refers to gl_DepthRangeParameters, this change is to add temporary check to make using reserved type name an error during parsing. Bug: angleproject:348313398 Change-Id: I6522566b1f590fe2b24534fb065625c4ac3b06c6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5645265 Auto-Submit: Erica Li <lerica@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Amirali Abdolrashidi ebb56cee 2024-05-31T15:10:37 Implement OES_tessellation_shader Based on the specs, there are no functional differences between OES and EXT. * Added validation for glPatchParameteriOES() and the core glPatchParameteri(). * Added the extension support for GLSL. * EXT_shader_io_blocks is implicitly enabled for the EXT geometry and tessellation shader extensions. * OES_shader_io_blocks is implicitly enabled for the OES versions of said extensions. * Added a test to make sure using this extension works instead of EXT. * Turned the repeated test code into a function: * testTessellationTextureBufferAccess * Skipped the tests that fail on various platforms. * It seems that these tests were being skipped before enabling this extension ("Not supported"). Bug: b/344030760 Bug: angleproject:345306326 Bug: angleproject:345304850 Bug: angleproject:345312771 Change-Id: I905da0132bf6525cb453dcaa613e4deb3155c4dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5595611 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Scott Marcy b793888a 2024-05-09T11:40:18 Deeply nested switch statements -> ambiguous error Improve the error reported (and potentially avoid a stack overflow crash) when parsing deeply nested `switch` statements. Limits the total number of nested switch and/or iterator statements to `mMaxStatementDepth` (defaults to 256). Bug: angleproject:8645 Change-Id: Iba4795db15c3859d172df8366bc7de3125c2d472 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5527630 Auto-Submit: Scott M <mscott@apple.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Scott Marcy 2ecfc5a1 2024-05-03T18:29:12 Issue 8644: Deeply nested iterator declarations can crash Avoid stack overflow crash when parsing nested iterators (especially `while` statements). Limits the number of nested iterator statements to `mMaxStatementDepth` (defaults to 256). Bug: angleproject:8644 Change-Id: I9b0fd2ab456c3cdd731b41ab97f495ae4dc0b0bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5519169 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kimmo Kinnunen <kkinnunen@apple.com> Auto-Submit: Scott M <mscott@apple.com>
Scott Marcy e088af30 2024-03-28T15:30:59 Parsing very long array declarations crash Avoid stack overflow crash when parsing arrays with a huge number of dimensions. Limits the number of array dimensions to `mMaxExpressionComplexity` (typically 256). Use `YYABORT` to abort parsing. Bug: angleproject:8610 Change-Id: Icf3914871b167c820b84ae8f3acba80dbd698af3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5424330 Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill f39a9659 2022-09-09T10:09:58 Update flex/bison binaries. These binaries were updated using update_flex_bison_binaries.py. Please see instructions in tools/flex-bison/README.md. flex is at version 2.6.4. bison is at version 3.8.2. Bug: None Change-Id: Ia3189b678fc8ddacdf14bbfd3f4750f938d32ac3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3886807 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Chris Dalton c460c299 2022-06-21T11:20:45 Implement GLSL additions for ANGLE_shader_pixel_local_storage Specs out, implements, and thoroughly tests the GLSL additions for ANGLE_shader_pixel_local_storage. Adds a simple transformation that rewrites PLS directly into shader images. Updates the existing PLS tests to use the newly built-in PLS features and ensures they continue passing. For now, applications call glBindImageTexture to configure their pixel local storage. The OpenGL ES API side of this extension will follow shortly. Bug: angleproject:7279 Change-Id: I141183069b5cbfcca01cbb77b5b36d3e5f834bf5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3761876 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Hans Wennborg 0c23c72b 2022-03-25T17:19:37 Suppress -Wunused-but-set-variable in Bison-generated code Recent Clang versions have enhanced the warning, causing it to fire in preprocessor_tab_autogen.cpp and glslang_tab_autogen.cpp. Since those are generated by Bison, we can't fix the code and instead should suppress the warning there. Bug: chromium:1309955 Change-Id: I31aa83571162310bef47a7ce84841446713a2d04 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3550200 Commit-Queue: Hans Wennborg <hans@chromium.org> Auto-Submit: Hans Wennborg <hans@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi dde409be 2021-10-04T22:05:47 Translator: Produce error on func(void, int) If void is specified, another parameter cannot follow. This change ensures that this produces an error. Bug: angleproject:6338 Change-Id: I18602ea4b52c96e498f4f2dc627d4ba2210d6fa7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3203795 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 3036e090 2021-07-29T15:55:39 Vulkan: Direct SPIR-V Gen: Support the precise keyword The precise keyword is different in GLSL in that it defines what arithmetic operations _that have led to the value being assigned to a variable_ should be done precisely (i.e. not "contracted"). A tree traverser is implemented that detects precise access chains and applies precise-ness to the right hand side of assignment expressions to said access chains. This is only done if the shader uses the precise keyword in the first place. The algorithm for this is inspired by the implementation in glslang. This change additionally: - Fixes parser to allow precise on function parameters - Fixes GLSL code generation to output precise on struct members and function parameters. Bug: angleproject:4889 Change-Id: Ie3808c3c8c08da308e88af20f5f90379d9d14d47 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3056369 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 0e1c90cf 2021-07-21T10:24:26 Translator: Validate function parameter qualifiers This change cleans up a confusion in EvqConst and EvqConstReadOnly, where the former was frequently used instead of the latter for function parameters. The change makes the following renames to make the intent of the relevant qualifiers clearer: EvqIn -> EvqParamIn EvqOut -> EvqParamOut EvqInOut -> EvqParamInOut EvqConstReadOnly -> EvqParamConst Bug: angleproject:4889 Change-Id: Idedd32c08a91de069b91b1657d6b783dddece04a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3041622 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 550f2a3e 2021-02-24T09:49:42 Vulkan: Shader support for EXT_shader_framebuffer_fetch_non_coherent Translator can accept gl_LastFragData and 'inout' variable to gain access to framebuffer attachment data. The Vulkan translator replaces it with the SubpassInput type variable. Note that this works only for the noncoherent version of the extension. Bug: angleproject:5454 Test: *EXTShaderFramebufferFetchNoncoherent*.* Change-Id: I392f84ee3ad3eb9fbd09d0b7ff83731a9a3f33f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2598060 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Jamie Madill e670fc72 2021-01-18T15:51:42 Implement shader compiler changes for Tessellation. Numerous rule changes to support validating Tessellation Control and Evaluation shaders. New per-patch inputs and output variable support. Includes a new traverser step that validates barrier function calls. Functionality changes upcoming in http://crrev.com/c/2568234 Bug: angleproject:3572 Change-Id: If8da1c21d30efa12c60ed0d6c3f8cf0b27e4c86f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2633936 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Shahbaz Youssefi abe96578 2020-11-30T14:09:11 Vulkan: I/O blocks: Support unsized arrays Geometry shader inputs have an extra array dimension, which can be unsized as it can be derived from the primitive type. This change fixes the grammar to support such arrays. Additionally, it enables EXT_shader_io_blocks automatically with EXT_geometry_shader and EXT_tessellation_shader per spec. Bug: angleproject:3580 Change-Id: Ia7eb3e8be28c2eef2072dbe2a546fa34973104ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2568242 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 8d63a7fc 2020-11-17T15:15:44 Basic support for running deqp khr gles32 tests Bug: angleproject:3647 Change-Id: Ia707ffcd41926662d1513f1a3bf49149b76f6b9c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2544920 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 738092ae 2020-11-18T07:58:53 Add auto generated code for GL_EXT_tessellation_shader To support tessellation, code and auto generated code are added. Entry points function, ShaderTypes, built in variables and constants, builtin function barrier and patch keyword are added. Bug: angleproject:3572 Change-Id: Ia5fe473e884466cb88cea7138e13377a1d7b4fa0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2538393 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 43acf3ba 2020-07-31T15:43:57 GL: Compiler changes for GL_OES_texture_buffer This extension is core in GLES 3.2 This CL enables the extension, added 412 new dEQP tests for texture buffer. 410 of these tests pass, but there are two tests that fail, detailed in anglebug.com/4933 Also includes a fix for completeness checks. Based on a CL by Jonah Ryan-Davis. Bug: angleproject:3573 Bug: angleproject:4933 Change-Id: I45759d765c88c64f21b592eab01d910dc4bc8da3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2521239 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Mohan Maiya 553726a4 2020-10-20T11:29:17 Vulkan: Add OES_shader_multisample_interpolation extension Addition of 'sample' qualifier keyword and 'interplateAt*' fragment shader builtin functions with autogen Bug: angleproject:3589 Change-Id: If358eb371fbcefffa715c8da4ba5e96eefaf6f52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477904 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis eadc387c 2020-04-01T16:53:31 GL: Support GL_OES_texture_cube_map_array in shader translator GL_OES_texture_cube_map_array is core in 3.2. This CL adds support for this extension in the shader translator. Now passes dEQP.KHR_GLES31/core_texture_cube_map_array.*, dEQP.GLES31/functional_fbo_color_texcubearray_*, and dEQP.GLES31/functional_opaque_type_indexing*samplercubearray* with GL backend. Bug: angleproject:3584 Change-Id: I1a8485c7d9d3fffb9b5109d292b35b0c56a3c665 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2133086 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Mohan Maiya 96c26c68 2020-04-03T07:52:52 Add support for NV_shader_noperspective_interpolation Added support for GL_NV_shader_noperspective_interpolation on the Vulkan and Desktop OpenGL backends Bug: angleproject:4388 Test: angle_end2end_tests --gtest_filter=ShaderInterpTest.NoPerspective/* Change-Id: I12473830c0ea8b4fffeae9c4a8ec92d979c8e18c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2107234 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yan 17b3c2f3 2019-10-14T14:13:59 Implement SamplerVideoWEBGL for WEBGL_video_texture extension on desktop WEBGL_video_texture is an extension that will improve uploading video frame to WebGL performance. (https://www.khronos.org/registry/webgl/extensions/proposals/WEBGL_video_texture/) This extension introduced a new texture type TEXTURE_VIDEO_IMAGE_WEBGL and a new sampler type samplerVideoWEBGL to sample it. In chromium implementation, TEXTURE_VIDEO_IMAGE_WEBGL maps to different native texture type based on platform. On desktop, it maps to GL_TEXTURE2D(Currently supported). On Android, it should map to GL_TEXTURE_EXTERNAL(TODO). SamplerVideoWEBGL needs to be mapped to sampler2D or samplerExternalOES according to TEXTURE_VIDEO_IMAGE_WEBGL implementation. This patch implements samplerVideoWEBGL in Angle to support WEBGL_video_texture on desktop. In this case, samplerVideoWEBGL should map to sampler2D. Bug: chromium:776222, angleproject:3889 Change-Id: Idb0a5fcde37ca75ccc1181226b91f257212e7500 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866274 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
James Darpinian d6053daa 2019-12-05T17:46:23 Remove tabs from source files. WebKit's Subversion repo refuses to commit source files that contain tabs. Bug: angleproject:3439 Change-Id: I0a804bcfa0375a98e19945e20297c90d31106827 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954410 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 795a3559 2019-12-03T11:31:18 Vulkan: EXT_gpu_shader5 support: precise The precise keyword is used in tessellation shaders but introduced in this extension. EXT_gpu_shader5 introduces a handful of features to shaders. This change only implements the `precise` keyword. Bug: angleproject:3569 Change-Id: I2252b79098eb8ba2d2faa040d7eaed7548b7051e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1939851 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 249cb200 2019-12-03T11:10:06 Translator: Rename TIntermInvariantDeclaration to ..GlobalQualifier.. This is to support the upcoming `precise` keyword. Bug: angleproject:3569 Change-Id: Idbcc8fd6f261757dbbf81b381e7a2dae938d8101 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1947451 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 5efb36b9 2019-11-25T16:14:55 Automatically call flex/bison if necessary ANGLE translator's parser code generation is changed to use the binaries of flex/bison stored in the cloud. scripts/run_code_generation.py now automatically runs these files if the input files change. Bug: angleproject:3419 Change-Id: Icce4247f93b27baf8ee12dbb16112fa2cc98c111 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1940572 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>