63 Commits
Author SHA1 Message Date
Alexey Knyazev 067ace47d0 Add ANGLE_clip_cull_distance extension
Added an extension spec.

Trivially exposed it on GL, Vulkan, and D3D11.

Adjusted tests and validation to allow no cull
distance support for this extension string.

Removed extra built-in variable definitions.

Bug: angleproject:7904
Change-Id: Ic60772dfe28132c316eaa29aadc1afd66e3b0fa7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4114290
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Alexey Knyazev <[email protected]>
2022-12-23 01:57:59 +00:00
Alexey Knyazev 7fefd2308f GL: Adjust APPLE_clip_distance exposure
Partial revert of
I458cad29c10b9d9193c5233e24bac53361ba104e

APPLE_clip_distance cannot be implemented on top of
EXT_clip_cull_distance because the former is defined both
for ES 2.0 and ES 3.0 while the latter is defined only for ES 3.0.

Although some ES 3.0+ drivers allow gl_ClipDistance built-in in
ESSL 1.00 shaders, this behavior is not specified so ANGLE should
not allow it.

Added independent ESSL 3.00 gl_ClipDistance and gl_MaxClipDistances
definitions.

Adjusted translator unit tests.

Bug: angleproject:4452
Change-Id: Ib582ce0ac7ccb65f0200ef1d17eaab0c83b228cf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963745
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2022-11-08 14:58:56 +00:00
Chris Dalton b5514bb256 Support pixel local storage on ES 3.0
Now that the application-facing API is implemented, we don't have to
rely on ES 3.1 anymore. Expose and test the extension on ES 3.0.

Bug: angleproject:7279
Change-Id: I5635620b9088201c20bafd283813092a329225d6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3915327
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Chris Dalton <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
2022-10-06 02:12:59 +00:00
Chris Dalton 861149c7ac Make PLS coherent on desktop OpenGL
Implements ANGLE_shader_pixel_local_storage_coherent using fragment
shader synchronization extensions:

  NV_fragment_shader_interlock
  INTEL_fragment_shader_ordering
  ARB_fragment_shader_interlock

With these extensions combined, we get coherency all 3 big desktop
vendors: NVIDIA, Intel, and AMD.

Bug: angleproject:7279
Change-Id: Ie20b251fb772898e89994b799640f1f2806581eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3773990
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2022-08-04 14:04:26 +00:00
Chris Dalton c460c29914 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 <[email protected]>
Commit-Queue: Chris Dalton <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2022-07-21 14:58:20 +00:00
Eddie Hatfield 7eb96f2a30 Refactor builtin symbol generation for C++17
Bug: angleproject:6747
Change-Id: I81a87b68298abc32fee7bb843c27a4a1b6009c87
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3719000
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Eddie Hatfield <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2022-06-24 20:02:59 +00:00
Shahbaz Youssefi 87ea0c7dfd Vulkan: SPIR-V Gen: Apply Flat to gl_Layer in FS
Not directly specified by the spec on gl_Layer itself, but required
according to this more generic statement:

> Fragment shader inputs that are, or contain, integral types must be
> qualified with the interpolation qualifier flat.

Bug: angleproject:7332
Change-Id: Ieaa389e9b1318d3f13147cba7949cff6491c4b61
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3652746
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Brandon Schade <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-05-18 18:30:28 +00:00
Shahbaz Youssefi 72529c1971 Vulkan: Fix a few framebuffer fetch bugs
A few fixes to framebuffer fetch:

- The built-in symbol for coherent and non-coherent are now the same for
  gl_LastFragData, so extension check can choose one or the other.
- The temporary variable used in a transformation is renamed to not be
  gl_LastFragData.
- inout usage is now validated correctly for shader type and version.

Bug: angleproject:6951
Bug: angleproject:6905
Bug: angleproject:6907
Change-Id: I9af341a3e8e01ed375a8230618184494813d3ece
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3427577
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2022-02-02 06:07:56 +00:00
Brandon Schade 38fada3510 Vulkan: Add support for OES_primitive_bounding_box
Add OES version of the primitive bound box extension

Bug: angleproject:3576
Test: dEQP-GLES31.functional.primitive_bounding_box.*
Change-Id: Ie44d952992a68dfffd5c124dda8dd11069f0c1e1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3425086
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Brandon Schade <[email protected]>
2022-02-01 19:26:04 +00:00
Jamie Madill cb96c236a2 Revert "Vulkan: Enable framebuffer fetch on SwiftShader."
This reverts commit 5107231939.

Reason for revert: Fails new code paths in Chrome+Skia.

Bug: angleproject:6947

Original change's description:
> Vulkan: Enable framebuffer fetch on SwiftShader.
>
> This also fixes a bug with non-coherent fetch in the symbol table.
>
> Bug: angleproject:6947
> Bug: angleproject:6948
> Change-Id: I190b2e0cddf1bc1b53a79079d3e2f79ccbb40d15
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3412998
> Reviewed-by: Shahbaz Youssefi <[email protected]>
> Reviewed-by: Cody Northrop <[email protected]>
> Commit-Queue: Jamie Madill <[email protected]>

Bug: angleproject:6947
Bug: angleproject:6948
Change-Id: I8bd6c55598552b733547e45c854f6d55768d2b65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3417503
Bot-Commit: Rubber Stamper <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2022-01-26 18:59:06 +00:00
Jamie Madill 5107231939 Vulkan: Enable framebuffer fetch on SwiftShader.
This also fixes a bug with non-coherent fetch in the symbol table.

Bug: angleproject:6947
Bug: angleproject:6948
Change-Id: I190b2e0cddf1bc1b53a79079d3e2f79ccbb40d15
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3412998
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2022-01-26 16:25:45 +00:00
Brandon Schade 28f223acb4 Vulkan: Add missing ESSL 3.2 builtin functions
Builtin functions from the "OES_shader_image_atomic" and
"OES_texture_storage_multisample_2d_array" extensions were missing from
ESSL 3.2 builtins.

Bug: angleproject:3578
Bug: angleproject:3583
Change-Id: Id372f0dcffee1eb376c66b9e4886ed50a08b1b0e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3391048
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Brandon Schade <[email protected]>
2022-01-18 22:19:47 +00:00
Yuly Novikov f64f9546ae Reland "Decouple gl_BaseVertex/gl_BaseInstance uniforms"
This reverts commit 10e5f34d14.

Reason for revert: exonerated from flaky crash suspect

Original change's description:
> Revert "Decouple gl_BaseVertex/gl_BaseInstance uniforms"
>
> This reverts commit 36bf1ebe5e.
>
> 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 <[email protected]>
> > Reviewed-by: Geoff Lang <[email protected]>
> > Reviewed-by: Kenneth Russell <[email protected]>
>
> Bug: angleproject:3402
> Change-Id: I75830baa14cf4e7c53750fd14ff76501145b4823
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3315610
> Bot-Commit: Rubber Stamper <[email protected]>
> Reviewed-by: Yuly Novikov <[email protected]>
> Reviewed-by: Kenneth Russell <[email protected]>
> Commit-Queue: Shrek Shao <[email protected]>

Bug: angleproject:6763
Bug: angleproject:3402
Change-Id: Ie436dc5d55364e464897d407a53b793941cd5d0b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3321703
Bot-Commit: Rubber Stamper <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2021-12-07 21:17:07 +00:00
Shrek Shao 10e5f34d14 Revert "Decouple gl_BaseVertex/gl_BaseInstance uniforms"
This reverts commit 36bf1ebe5e.

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 <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>
> Reviewed-by: Kenneth Russell <[email protected]>

Bug: angleproject:3402
Change-Id: I75830baa14cf4e7c53750fd14ff76501145b4823
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3315610
Bot-Commit: Rubber Stamper <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Shrek Shao <[email protected]>
2021-12-04 00:59:38 +00:00
Shrek Shao 36bf1ebe5e 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 <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2021-12-02 00:01:49 +00:00
Shahbaz Youssefi 0bb3fcbb02 Translator: Fix precision of gl_PointSize on ES3+
In ESSL100, gl_PointSize is declared as mediump.  In ESSL300+, it's
declared as highp.

Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: Ie904a12fdaaca04e2507f1796d9d0fe34b154eab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3145615
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-09-08 01:00:15 +00:00
Shahbaz Youssefi 3408ea3ea4 Translator: Fix precision of gl_FragCoord on ES3+
In ESSL100, gl_FragCoord is declared as mediump.  In ESSL300+, it's
declared as highp.

Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: I42583d07fb745421f195be95fa404c617227b02e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3116307
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-08-25 01:52:54 +00:00
Shahbaz Youssefi a08b667d32 Translator: Stabilize autogenerated builtin function parameters
When pruning the list of builtin function parameters, sorted() is used
to stabilize the result.  This makes reviews of changes to the
autogenerated output easier.

Bug: angleproject:4889
Change-Id: I97afc31de2a62b34a0a8183bb5a47eab9e62d9fc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3116306
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-08-24 20:30:45 +00:00
Shahbaz Youssefi 061188a7e9 Translator: General clean up
General clean up done as part of other changes, split to simplify
review.

Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: Iade9954d187a759be9edd0e3754be007f4133c56
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3071598
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-08-05 19:30:45 +00:00
Shahbaz Youssefi 1ce7839728 Remove support for WEBGL_debug_shader_precision
This extension was rejected, and the implementation was hacky.  This
clean up is part of an ongoing work to improve precision handling.

Bug: angleproject:6059
Change-Id: If08581ec6f19cf1698ffa3dd6d248dc5e68a1d31
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3064303
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-08-04 20:07:30 +00:00
Brandon Schade 217acac2b4 Vulkan: Add support for EXT_primitive_bounding_box
1. Added support for EXT_primitive_bounding_box extension
2. Renamed shader variable gl_BoundingBoxEXT[] to ANGLEBoundingBox[]

Bug: angleproject:3576
Test: dEQP-GLES31.functional.primitive_bounding_box.*
Change-Id: I15fa9af50c6fd8e86d225670ddd8eb39f6e65d35
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3053618
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2021-08-04 12:35:16 +00:00
Shahbaz Youssefi 96ccf3f43e Translator: Consolidate EvqFragDepth and EvqFragDepthEXT
They were the same thing.  Fixes SPIR-V generation which only handled
EvqFragDepth.

Bug: angleproject:4889
Change-Id: Id2c35f4c5a26e43ad16a420cc0306756a1add082
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3059922
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-07-30 14:59:08 +00:00
Shahbaz Youssefi dbe986d710 Vulkan: SPIR-V Gen: Fixes to tessellation shader support
- TCS barrier() built-in is correctly looked up
- Patch decorations are fixed

Bug: angleproject:4889
Change-Id: I1befcaca85a965c9d46b1b41ec74597de44bf2b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3052687
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-07-27 02:04:51 +00:00
Shahbaz Youssefi acfd63a4cc Translator: Remove GLSL rules from the ESSL-only symbol table
Shaves ~36KB off of ANGLE's binary size on Android.

Bug: chromium:1084580
Change-Id: I4711c6bd28437a43b7dc63be4cfcdaed7ae11ba2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3052686
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-07-27 02:01:41 +00:00
Shahbaz Youssefi 45d4641a4c Vulkan: SPIR-V Gen: Support tessellation shaders
Bug: angleproject:4889
Change-Id: I7370e037a82689260e27bfd5e72c5c8c982efa58
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3041624
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-07-23 02:22:56 +00:00
Shahbaz Youssefi 0e1c90cf4f 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 <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-07-22 02:03:13 +00:00
Shahbaz Youssefi 05eb0a3291 Translator: Allow subpassLoad in AST in ESSL
subpassLoad is available to desktop GLSL, but not GLSL ES.  With this
change, subpassLoad is made available internally to the AST so that
framebuffer fetch's use of this built-in can be simplified.
Additionally, this makes the tree more consistent in that there's no
function call without a corresponding function declaration.

A follow up change will add an AST validation to enforce this.

Bug: angleproject:4889
Bug: angleproject:5454
Change-Id: I3fa502dc4b29eab7f34940466e283cffd218d746
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3040118
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-07-20 21:07:32 +00:00
Shahbaz Youssefi e2710f598e Vulkan: SPIR-V Gen: Fix image atomic built-ins
The `imageAtomic*` built-ins additionally include coordinate and
sample parameters that need to be fed to OpImageTexelPointer before the
atomic operation can be generated.

This change passes all *image*atomic* GLES31 deqp tests as well as:

    GLSLTest_ES31.ArraysOfArraysOfR32fImages/ES3_1_Vulkan_DirectSPIRVGen

Bug: angleproject:4889
Change-Id: I9ed729d09914cb01467d4de504de38c931a9196e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3011419
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-07-09 20:23:25 +00:00
Shahbaz Youssefi 0461d8d458 Vulkan: SPIR-V Gen: texture and image built-ins
GLSL contains a large number of built-in texture* and image* functions,
but these map to only a handful of SPIR-V instructions.  The bulk of the
work to map these is to extract the arguments from the built-ins based
on their ordinal position.

Bug: angleproject:4889
Change-Id: I760d986bd9171ddde35f9f046c549ca53252df17
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2992980
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-07-05 22:26:56 +00:00
Shahbaz Youssefi c3c934a3e8 Translator: Better group ES100 texture builtins
The ES100 texture built-ins are now (similarly to ES300 ones) grouped
based on whether they include a Bias, or Lod.

Bug: angleproject:4889
Change-Id: I495af48644c68286b1b0cc2a5580566fdd22cfc9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2987859
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-06-25 20:39:31 +00:00
Shahbaz Youssefi 64ce506d05 Vulkan: SPIR-V Gen: Support most non-texture/image built-ins
Most GLSL built-ins map directly to some SPIR-V operation.  texture*()
and image*() built-ins are not implemented as well as a handful of other
built-ins that require special-handling.

Bug: angleproject:4889
Change-Id: I72abfb4692c3d66a3c8be43ce44ba6808efe6255
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2971646
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-06-22 19:48:21 +00:00
Shahbaz Youssefi 8b869a955d Translator: Generate Ops for all built-in functions
EOpCallBuiltInFunction is removed in this change, as well as the
"op": "auto" property in builtin_function_declarations.txt.  Instead,
gen_builtin_symbols.py automatically generates Ops for every built-in
function and generates the TOperator enum accordingly.

This simplifies SPIR-V code generation by allowing switches to be used
on operators instead of string comparisons.

Bug: angleproject:4589
Bug: angleproject:4889
Change-Id: Ia351524400b0e12a10a5572e27e9b88c6ec2e61c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2958869
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-06-16 04:34:41 +00:00
Brandon Schade 69f2fb0066 Vulkan: Expose OES_geometry_shader extension
Modify the symbol table generation script to accept a list
of supported extensions. This allows for the EXT and
OES versions of the geometry shader extension to be exposed.

Test: angle_deqp_khr_gles31_tests --deqp-case=*geometry_shader*
Bug: angleproject:3571
Change-Id: Ia7127a03dbd3fce78957f0505d3ce0c9bab6cb15
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2765011
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2021-06-08 23:16:33 +00:00
Shahbaz Youssefi d469dcb141 Translator: remove image2DRect
There is no such thing as image2DRect in GLSL.  imageRect (the right
type) is present, but the code was mistakenly using image2DRect.

Bug: angleproject:4889
Change-Id: I42bacd2ad8866c715af0d9711bebc95897607354
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2878095
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-05-08 04:01:15 +00:00
Shahbaz Youssefi 1f8e35b55d Remove EvqBaseVertex and EvqBaseInstance qualifiers
They are only used to mark angle_BaseVertex and angle_BaseInstance
uniforms, but they make it complicated for the rest of the code to
identify them as uniforms.

Bug: angleproject:4889
Change-Id: I0c632bb595dc9a7fcda19db11ecb27539b1c33e6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2818144
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-04-12 22:03:24 +00:00
Alexey Knyazev 54294c9a43 Partially upgrade codegen to Python 3
Bug: angleproject:5707
Change-Id: I4e26c2c7ba4a36185b28ecd6e87be1161b60431a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2729567
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-03-04 16:47:52 +00:00
Mohan Maiya 550f2a3e83 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 <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Mohan Maiya <[email protected]>
2021-02-24 21:44:25 +00:00
Shahbaz Youssefi 5e0a8f9b82 Translator: Enable geometry and tessellation in ES3.2
Symbols that these extensions introduced were only accepted if the
extension directive was present.  This is not necessary for es 320
shaders.  This change adds a new tag to builtin variable and function
declarations in the translator, namely "essl_extension_becomes_core_in"
which makes gen_builtin_symbols.py automatically create two entries for
the builtin; one with the specified level and extension, one with the
core level and without extension.  Entries in
builtin_function_declarations.txt can potentially be deduplicated as a
follow up to take advantage of this tag, though likely an anologous
"glsl_extension_becomes_core_in" needs to be introduced.

Bug: angleproject:5557
Bug: angleproject:5579
Change-Id: I84c19f48a3ccc89d82d80a4f35f7833205bbc88f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2649449
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-01-28 12:20:08 +00:00
Mohan Maiya 8f9e17d529 Add EXT_clip_cull_distance extension autogen code
Addition of shader autogen code for EXT_clip_cull_distance extension.

Bug: angleproject:5458
Change-Id: I299528957c0e747fd84987c420588c314f54aae0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2590989
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-12-15 21:54:35 +00:00
Mohan Maiya 8a401051a8 Vulkan: Support OES_sample_variables extension
Enable OES_sample_variables extension on Vulkan backend.
Add support for built-in variables, uniform state and constants
- gl_SampleId, gl_SamplePosition, gl_SampleMask,
  gl_SampleMaskIn
- gl_NumSamples
- gl_MaxSamples

Bug: angleproject:3588
Tests: dEQP-GLES31.functional.shaders.sample_variables.*
       KHR-GLES31.core.sample_variables.*
Change-Id: Idf37c7b4ccb0331dbda7acd6389ff4e1022ba959
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477907
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-11-19 17:47:55 +00:00
Mohan Maiya 738092aead 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 <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-11-18 17:27:55 +00:00
Jamie Madill aca3d40810 Fix return value of cube map array imageStore.
Should be void according to the spec. Noticed while working on texture
buffer.

Bug: angleproject:3584
Change-Id: I79a671c82fa117bab69bc2e6b35c840aa30429c5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2521241
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-11-07 20:02:29 +00:00
Jamie Madill 43acf3badf 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 <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2020-11-06 23:09:57 +00:00
Jamie Madill f2a789263b Symbol Table: Error on duplicate group keys.
This prevents newer group keys from overwriting old ones.
Prevents bugs from creeping in like happened during texture buffer
development.

Bug: angleproject:3573
Change-Id: Iea69cac988e2cf4802a9f64c54cb694d32f1d3e1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2521238
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-11-06 16:11:04 +00:00
Mohan Maiya e895ced6d4 Vulkan: Add OES_shader_image_atomic support
Add support for shader builtins and enable the extension.

Bug: angleproject:3578
Tests: dEQP-GLES31.functional.*image_atomic*
Change-Id: Idd45b2ee62efe1474c6c5947c77da64ff2221bf6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2505540
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-10-29 20:43:25 +00:00
Mohan Maiya 553726a4c5 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 <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-21 04:57:21 +00:00
Trevor David Black e815afbf88 First pass at increasing inclusivity
Link to the inclusivity rules
https://source.android.com/setup/contribute/respectful-code

Bug: b/162834212
Bug: chromium:1097198
Change-Id: Ied5a9e3879d72bff3f77ea6fcda9b82f30c32c2f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2396737
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Trevor Black <[email protected]>
2020-10-02 19:49:38 +00:00
Geoff Lang 7e815c77a4 Implement EXT_shadow_samplers
Bug: angleproject:4863,b/161716126
Change-Id: I6beb45d91f59a851787c9f40b40266fb985198d5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2288330
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: back sept 10 - Jamie Madill <[email protected]>
2020-09-01 19:30:14 +00:00
Jonah Ryan-Davis eadc387c3e 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 <[email protected]>
Commit-Queue: Jonah Ryan-Davis <[email protected]>
2020-05-27 17:07:26 +00:00
Le Hoang Quyen dadd198650 Implement GL_APPLE_clip_distance
- Built-in variable gl_ClipDistance has been added to compiler.
- Desktop GL: gl_ClipDistance is supported since GL 3.0. Enable/Disable
each gl_ClipDistances[i] works out of the box via glEnable().
- Vulkan/Metal: Use uniform variable to control writing to each
gl_ClipDistance. One bit flag controls one element in the gl_ClipDistance
array. The writing to the disabled element in vertex shader will be
ignored, and turned into zero assignment instead.
- Direct3D/Mobile GL: Not implemented yet.
- Added ClipDistanceTest to gl_tests and compiler unittests.
- GL_APPLE_clip_distance is a subset of GL_EXT_clip_cull_distance, so
GL_EXT_clip_cull_distance could be implemented in future if needed.

Bug: angleproject:4452
Change-Id: I571ac8b56826989808a680226a04bec4cf59988e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2084324
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-04-22 18:17:56 +00:00