22 Commits

Author SHA1 Message Date
Geoff Lang
4e6124dae8 GL: Ensure all instanced attributes have a buffer with data
Apple OpenGL drivers sometimes crash when given an instanced draw with
a buffer that has never been given data.

It's not efficient to check if the attribute is both zero-sized and
instanced so just ensure that every time a zero-sized buffer is bound
to an attribute, it gets initialized with some data.

Bug: chromium:1456243
Change-Id: I66b7c7017843153db2df3bc50010cba765d03c5f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4642048
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2023-07-11 17:25:50 +00:00
Shahbaz Youssefi
f5ad056b0d GL: Fix ScalarizeVecAndMatConstructorArgs and move to gl/
This transformation was buggy and was disabled.  Originally, it was
intended to be used everywhere.  It is now needed for a GL driver
workaround.

This change reimplements this transformation and uses it as a GL
workaround.

Bug: chromium:1420130
Change-Id: I42d63fa5844bcf683ac41e61925aa637e033ca2e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4676634
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2023-07-11 15:08:28 +00:00
Kramer Ge
88c6dfcc7d Mali: Make the placeholder FBO complete for timer queries
Change the bindFramebufferForTimerQueries workaround to ensure
the framebuffer is complete.

Bug: chromium:1356053,b/269068358
Change-Id: Ief3198fdc4800468670a3f4323a1ffd3ca083c6f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4582606
Auto-Submit: Kramer Ge <fangzhoug@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-06-15 15:26:04 +00:00
Brian Ho
ea0b1b7b0e Selectively advertise base vertex and instance fns
On newer Mali GPUs (Valhall), the glDraw*BaseVertex* implementations
seem to be buggy and cause noticable artifacts. Chrome uses the
presence of baseVertexBaseInstanceANGLE and baseInstanceEXT
extensions to determine whether it can draw with a base vertex or to
fallback to manually offsetting the vbo.

This CL disables these extensions on Mali Valhall so that Chrome
takes the fallback path instead to fix the visual artifacts.

Bug: b/280931795
Change-Id: Ic27e37465283ca3338747b53aa7888c7eba4b7b8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4549682
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2023-05-19 21:05:57 +00:00
Geoff Lang
b1395bcbac GL: Disable EXT_clip_control on Mali-G72 and G76.
Querying the clip control state from the driver when sychronizing
external contexts generates driver errors.

Simply disable this extension in this configuration for now.
Chrome is currently not using it for rasterization.

This issue was noticed on specific Huawei devices in the wild. It
hasn't been observed on other OEMs.

Bug: chromium:1434317
Change-Id: I88d9bff1933274f61020b75e68aee9c94b0b684a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4518062
Reviewed-by: Peng Huang <penghuang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
2023-05-11 16:26:30 +00:00
Kramer Ge
888ca8d9e3 Bind FBO before timer query on Mali GL driver.
glBeginQuery(GL_TIME_ELAPSED/GL_TIMESTAMP) on Mali implementation
assumes a complete FrameBuffer. Without it glGetQueryObject will return
a meaningless value, causing some applications to misbehave.

This workaround caches and binds a default FBO in this case.

Bug: chromium:1356053,b/269068358
Change-Id: I756ded948c2c5aada744f9dd428ad77c37a009c6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4359032
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Kramer Ge <fangzhoug@chromium.org>
2023-03-22 16:49:48 +00:00
Alexey Knyazev
28e7adca96 GL: Implement clip distance state emulation
Pass the current set of enabled clip distances
to vertex shaders via an internal uniform and
dynamically set disabled elements to zero.

Bug: angleproject:7880
Change-Id: I709d31dc7ca0606decf49adf674460a941837683
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4094314
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2022-12-20 05:05:49 +00:00
Chris Dalton
5e95a4d9b7 Add an EXT_shader_pixel_local_storage impl of PLS
Translates ANGLE_shader_pixel_local_storage shaders directly to
EXT_shader_pixel_local_storage.

Polyfills load/store operations using internal fullscreen draws.

Since the ANGLE extension needs the ability to preserve all active PLS
planes to textures, we can only support this extension when the backend
context also has access to ES 3.1 shader images.

Bug: angleproject:7279
Bug: angleproject:7771
Change-Id: Id348bde412efcc081ff29ee05ec59ad652f77569
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3966075
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2022-11-03 14:41:47 +00:00
Alexey Knyazev
fec93f40d3 GL: Support clip and cull distance extensions
Use EXT_clip_cull_distance on OpenGL ES to expose
APPLE_clip_distance; use ARB_cull_distance on OpenGL
to expose EXT_clip_cull_distance.

Added disableClipCullDistance OpenGL workaround.

Bug: angleproject:4452
Change-Id: I458cad29c10b9d9193c5233e24bac53361ba104e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3956075
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2022-10-19 01:08:04 +00:00
Chris Dalton
a81679bc83 Support EXT_shader_framebuffer_fetch on GLES
All the frontend functionality for EXT_shader_framebuffer_fetch is
already present, but only supported on Vulkan. This change wires it up
for the native GLES backend as well.

Bug: angleproject:7279
Bug: angleproject:7703
Change-Id: Ie1fce79e08a78662c8af65d33f3d8417c96cf58e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3920577
Commit-Queue: Chris Dalton <chris@rive.app>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2022-09-30 21:38:32 +00:00
Chris Dalton
4a636cdd41 Require all PLS formats to consume exactly 4 bytes of storage
D3D 11.0 UAVs only support R32_FLOAT, R32_UINT, R32_SINT formats.

EXT_shader_pixel_local_storage explicitly states that all PLS variables
consume exactly 4 bytes.

ESSL images can only have both read and write access if their format is
r32f, r32i, r32ui. (We were able to circumvent this via aliasing, but it
was a huge source of bugs.)

There is a large precedent for only supporting 4 bytes of storage in the
capabilities we use for PLS, so this CL removes support for all PLS
storage formats that are not 4 bytes. It also implements an "R32" mode
for PLS, that does manual packing and unpacking of r32* image formats.
If the application wants larger formats, it can always define multiple
PLS planes and piece them together.

Next up we ought to be able to support rg16* types with more
packing/unpacking.

With aliasing gone, and with a bit of tweaking, the PLS tests now pass
on the Pixel 4 GLES bot.

Bug: angleproject:7279
Bug: angleproject:7388
Bug: angleproject:7524
Bug: angleproject:7527
Change-Id: I6b8f62c2428ade6cb5413e33360d734e55dda0eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3782579
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Chris Dalton <chris@rive.app>
2022-08-11 18:05:32 +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 <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2022-08-04 14:04:26 +00:00
Bo Liu
57ccd974ba Make limit_max_texture_size_to_4096 webgl only
Bug: chromium:1319451
Change-Id: I7dedeb8d738c1070e650650e893d57984a9e7956
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3739439
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2022-08-03 20:59:36 +00:00
Alexey Knyazev
5897d6f594 GL: Add emulateCopyTexImage2D workaround
Using texImage2D + copyTexSubImage2D seems to be
more stable than using copyTexImage2D directly.

Added missing HALF_FLOAT fix to the code path that
requires target texture initialization.

Fixed target texture dimensions when initialization
is not required.

Fixes Apple GPU crashes in:
* CopyTexImageTest.DeleteAfterCopyingToTextures
* conformance/textures/misc/texture-copying-and-deletion.html
* conformance/textures/misc/texture-copying-feedback-loops.html

Bug: angleproject:5038
Bug: angleproject:5360
Bug: chromium:1130703
Change-Id: I5cce087983601e768902f01b3462ec2106e2500a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3749921
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Gregg Tavares <gman@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
2022-07-13 19:10:51 +00:00
Geoff Lang
d670b5a36b GL: Disable texture border clamp on imagination.
IMG GPUs generate INVALID_ENUM when setting the texture border color.

Bug: angleproject:7405
Change-Id: I04a28d36943c143ad5e18bf80e618230b116a632
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3692265
Reviewed-by: Peng Huang <penghuang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2022-06-07 17:49:48 +00:00
Amirali Abdolrashidi
38a53d654c Revert "Remove limit_max_texture_size_to_4096 workaround"
This reverts commit bcc03bd622.

Reason for revert: ANGLE autoroller fails on some Pixel 4 web conformance tests.

Original change's description:
> Remove limit_max_texture_size_to_4096 workaround
>
> Chromium will apply workaround to gpu command buffer clients only. So
> removing it from angle which is no longer needed.
>
> See crbug.com/1319451 and in particular crrev.com/c/3626252
>
> Bug: chromium:1319451
> Change-Id: I723e525600aa7b93e784c98348e060a503c09657
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3618501
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
> Reviewed-by: Lingfeng Yang <lfy@google.com>
> Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>

Bug: chromium:1319451
Change-Id: I0db424e97ebb0f9141076b409667aa49faeb2ec4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3630919
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
2022-05-06 18:10:51 +00:00
Bo Liu
bcc03bd622 Remove limit_max_texture_size_to_4096 workaround
Chromium will apply workaround to gpu command buffer clients only. So
removing it from angle which is no longer needed.

See crbug.com/1319451 and in particular crrev.com/c/3626252

Bug: chromium:1319451
Change-Id: I723e525600aa7b93e784c98348e060a503c09657
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3618501
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-05-05 19:12:31 +00:00
Shahbaz Youssefi
5113ae8ef0 Vulkan: Explicitly enable per-sample shading if sample used
The Vulkan spec is not explicit about the `Sample` decoration implicitly
enabling per-sample shading.  While this is being corrected in the spec,
the ARM Vulkan driver does not have this implicit behavior.

A workaround is added such that the usage of the `sample` qualifier is
reported, and used to explicitly enable per-sample shading through the
API.

Bug: angleproject:6876
Change-Id: Idb8345aacdcfa45cb37fefcd30aa5405168d21e3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3615738
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2022-05-03 03:37:33 +00:00
Alexey Knyazev
f7615d0ade OpenGL: Add allow_astc_formats workaround
Enable ASTC on Mesa only for supported hardware

Bug: angleproject:7259
Change-Id: I872ebdead1206ee911c5e0f0f10b6985022dbe47
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621055
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
2022-05-02 18:47:55 +00:00
Shahbaz Youssefi
4dc4c0f051 Remove whitespace from features json files
Bug: angleproject:6435
Change-Id: I7f653a9836180d0f2e0198302e11ae2b0ca49d3b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3621315
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-05-02 16:56:22 +00:00
Shahbaz Youssefi
fcec69045d Generate feature variable names from display names
The json file now only contains the feature display name.  The variable
name is automaticaly derived.

For consistence with Chromium and other Chromium-based projects, the
display name is now always snake_case, and that's what's specified in
the json files.  This also makes camelCase variable name generation
trivial (as opposed to the other way around).

Feature overrides now accept both snake_case and camelCase names to
ensure compatibility with existing scripts.  This is done by removing _
and comparing override names with feature names in lower case.

Bug: angleproject:6435
Change-Id: I0b6ed2bbf5c312bc4f4be7b3c7d55dbaca2a9886
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584630
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-04-20 05:05:22 +00:00
Shahbaz Youssefi
eeb3965353 Autogenerate features
Features are now specified in a json file and autogenerated.  This is in
preparation for more autogeneration to support feature override in
tests.

This change doesn't yet fix the issues in anglebug.com/6435 and should
be a no-op.

Bug: angleproject:6435
Change-Id: Icdb63a94dc37b5fef0a356e0fc0b49937e083c8a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3579941
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-04-12 03:20:38 +00:00