70 Commits

Author SHA1 Message Date
Phan Quang Minh
ef4327f6aa Vulkan: Make UtilsVk::copyImage copy YCbCr images properly
This changes the descriptor binding for the image from
VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE to
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER for YCbCr source textures and
ensures that the copy pipelines and descriptor sets for YCbCr source
textures are created with the appropriate YCbCr samplers, and use the
`texture()` function instead of `texelFetch()` for YCbCr images.

Bug: angleproject:8252
Change-Id: Ife3e230d3669b275f4e0fab1922d75b6b6c4f8bd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4675806
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2023-07-19 14:44:41 +00:00
Shahbaz Youssefi
0892420bcf Vulkan: Optimize PBO download between RGBA and BGRA
Google Meet hits this path in Chrome when blurring the background.  The
CPU readback was particularly slow on Intel/Mesa where readback from the
temp buffer took hundreds of milliseconds.

This change adds a compute shader that directly copies from the image to
the pack buffer in simple but common cases.

Bug: b/286882707
Change-Id: I9877ea01e3d8377db96f2539362aca67cf832b4a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4657058
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
2023-07-06 17:45:07 +00:00
Roman Lavrov
8447e2792a code_generation_hashes json files end with newline
Bug: None
Change-Id: Iddd2c1777a1d5486a4d390c6e3d56ffb09f47f02
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4574569
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Roman Lavrov <romanl@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
2023-05-30 18:08:28 +00:00
Hailin Zhang
1301402c53 Vulkan: improve etc to bc grident texture precison.
ETC has gradient modes. Two endpoints in BC are RGB565;
the color depth is lower than ETC. Two endpoints in
RGB888 space may be quite different, but after conversion to
RGB565 they may be projected to the same point.
This conversion loses quite a lot of details.

This change tries to change one endpoint to an adjacent one
(not optimal) in RGB565, so that all the colors are interpolated
 from these two endpoints. With this change,
the arknight image in b/259327729 improved PSNR from 39 to 49.

This change includes some of work by @gregschlom

1) Use look up table instead of bit operation.
2) Use more vector operations. This may not improve the performance
but makes the code short and neat.

bug: b/259327729
Change-Id: Ic0720aff17af5d466e5598dc38ba953dc084a3cc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4368021
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Hailin Zhang <hailinzhang@google.com>
2023-03-25 04:44:08 +00:00
Hailin Zhang
8fef41a830 vulkan: improve EtcToBc transcoding precision.
Bug: b/262352590
Change-Id: I6b127acdec28053423423f64ebc6e8561614f0ab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4290347
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Hailin Zhang <hailinzhang@google.com>
2023-02-24 18:51:37 +00:00
Charlie Lao
71d28a9bbe Vulkan: Remove unused ShaderAndSerial
The serial in the ShaderAndSerial is unused. This CL removed
ShaderAndSerial and replaced with ShaderModule directly.

Bug: b/257116399
Change-Id: I50d42af7818a12888309a80423531d75135e0bfd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3998747
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2022-11-03 18:46:16 +00:00
Shahbaz Youssefi
9b5fff82b5 Vulkan: Emulate shader stencil export for MSRTT
The MSRTT emulation code had one corner case issue that could lead to
performance and memory inefficiencies.  That is when stencil needs to be
unresolved and VK_EXT_shader_stencil_export is not supported.

This change adds a path to emulate VK_EXT_shader_stencil_export and
removes this inefficiency.

This should help Chromium on older Android devices that lack both this
and the recent VK_EXT_multisampled_render_to_single_sampled extensions.
Chromium frequently breaks the render pass (crbug.com/1336981), which
easily leads to this situation.

Bug: angleproject:4836
Change-Id: Ifceec43f7f3807b7e32f4b379edcd4351ae76414
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3935892
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2022-10-12 02:01:56 +00:00
Hailin Zhang
836cc5e2ce Vulkan: add etc to bc compute transcoding.
use compute shader to transcode etc format to bc format.

Bug: b/243398683
Change-Id: Idbd0820a2df8d92fe690055dae2933bc559e9bfd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3888501
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Hailin Zhang <hailinzhang@google.com>
2022-09-30 23:05:12 +00:00
Shahbaz Youssefi
6d3c637052 Vulkan: Fix 180 and 270 degree rotated resolve
Bug: angleproject:7197
Bug: b/235877059
Change-Id: I4d4ee622f49bb3218449414a1f0dd91fa4e4f541
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3708997
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
2022-06-22 22:56:52 +00:00
Shahbaz Youssefi
31321cb738 Vulkan: Remove suppressions and workarounds for old AMD/Windows
The old AMD/Windows bots are decomissioned.  This change removes
suppressions and workarounds that were added for that bot.

Bug: angleproject:2463
Bug: angleproject:2809
Bug: angleproject:2847
Bug: angleproject:3243
Bug: angleproject:4720
Bug: angleproject:6123
Bug: angleproject:6652
Bug: angleproject:7144
Bug: angleproject:7227
Bug: chromium:1224996
Change-Id: I333ed6d76dfa2916b713ccb49127deceb5b1b551
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3634728
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-05-09 21:42:14 +00:00
Mohan Maiya
19f405318f Vulkan: Enable subgroup feature in GenerateMipmap.comp
Enable subgroup feature to optimize shaders used for generating
mipmaps. Remove definition of SPD_NO_WAVE_OPERATIONS to enable
subgroups. Regenerate all internal shaders with target as
vulkan 1.1 to enable subgroup feature.

Bug: angleproject:7006
Change-Id: I36f50f3d27517fedb52e3028a8f6288347b1bfa0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3453288
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
2022-02-14 17:43:25 +00:00
Shahbaz Youssefi
038adcae47 Vulkan: Render the overlay in the graphics pipeline
Bug: angleproject:6976
Change-Id: I388d429f0726b4d6a1c4ecd446ead93579a14a1b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3448643
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-02-10 22:15:28 +00:00
Shahbaz Youssefi
5b43a30e3e Overlay: Rearrange the font image
Each glyph is now placed in a separate layer, and the image is made
mipped.  This is to prepare for FS-based rendering of the overlay and
provide more flexible sizing of the font.

Bug: angleproject:6976
Change-Id: Iefe139d1801c22ce303e445f5759f9b25597cdce
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3448710
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2022-02-08 20:01:39 +00:00
Yuxin Hu
a026d05360 Add support for subgroupSize of 16 in Debug Overlay Module
The subgroupSize on some Android devices is 16, which is not
supported by current OverlayCull and OverlayDraw compute
shaders. This change adds support for subgroupSize of 16.

This change also removes the subgroupBallot and subgroupArithmetic
paths in OverlayCull compute shader.
These two paths were added by Shabi as an experiment,
and he suggested to remove them for easier code maintenance purposes.

Bug: angleproject:6806
Change-Id: I5ce68cb18fbf3472c987d811c89f065cb8581858
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3352865
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
2022-01-11 18:02:50 +00:00
Charlie Lao
6cb599f9d2 Vulkan: Change dest to dst for consistency
Cleanup only, no functional change. dst aligns better with src.

Bug: angleproject:6502
Change-Id: I69821b1aae50a7ce647c7cc876468b6de309eec8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3208514
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
2021-10-11 17:35:55 +00:00
Lingfeng Yang
95a5bbd4fa Rename FullScreenQuad.vert to FullScreenTri.vert
Bug: angleproject:6505
Change-Id: Iafe26ddce51862edcb405f7ca85997a7c3b26fa7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3203172
Commit-Queue: Lingfeng Yang <lfy@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-10-07 13:46:34 +00:00
Shahbaz Youssefi
e354ff1a51 Vulkan: Allow DynamicBuffer suballocation in BufferVk
When allocations are made from DynamicBuffer, they suballocate from a
possibly larger BufferHelper.  In BufferVk, the offset of the
suballocation was discarded, which limited the use of DynamicBuffer to a
pool of small buffers.

This change applies any such offset that may arise from suballocations
everywhere, and makes BufferVk use a larger buffer size when the
GL_DYNAMIC_* buffer usage hints are provided.

Bug: angleproject:5719
Change-Id: I3df3317f7acff1b1b06a5e3e2bb707616a7d0512
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2738650
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-05-13 17:15:41 +00:00
Shahbaz Youssefi
0273ea3f4f Vulkan: Use RGBA16_FLOAT for buffer format fallback
... instead of RGBA32_FLOAT.  VK_FORMAT_R16G16B16A16_SFLOAT has
mandatory support for vertex buffers.

Bug: b/184163871
Change-Id: I7ef2933cd15e46bb984e6fd1b020d2ec15b9c60e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2807780
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-04-10 04:04:31 +00:00
Shahbaz Youssefi
0224e8480f Vulkan: Fix overlay graph widgets
Bug: angleproject:5690
Change-Id: I9a63fd91c7403f8bf1ee6ef25fc636aecfbe6ea0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2732533
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2021-03-04 11:37:14 +00:00
Shahbaz Youssefi
49211c31dc Vulkan: Fix Overlay for prerotation
Bug: angleproject:5690
Change-Id: I906a259767c54e3ac9f3ac822b6d5ed5dcaa0bd5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2725768
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
2021-03-04 09:52:02 +00:00
Shahbaz Youssefi
90db604919 Vulkan: Workaround Overlay draw issue on Android
On Android vector[n] translates to vector[0] likely due to a driver bug.
This resulted in text such as:

    12345678abcdefghijklmnopqrstuvwx

to render as:

    1234123412341234ijklijklijklijkl

It also made graph data flicker.  As a workaround, the shader now does
an if-else on the value of n and uses a constant to load the appropriate
component of the vector.

Bug: angleproject:5690
Change-Id: Idb891e726fafa896a1064ef7b2941b8fd1c41ed1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2725769
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2021-03-03 22:43:51 +00:00
Shahbaz Youssefi
07025aa347 Overlay: Widget for vk::DynamicBuffer allocations
Bug: angleproject:5690
Change-Id: Idfa591903627bbebffe306b387e95cbec1195338
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2725767
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2021-03-03 17:42:15 +00:00
Lubosz Sarnecki
46a955f869 gen_vk_internal_shaders: Don't include full path on Python 3.4+.
Since Python 3.4 `__file__` represents an absolute file path:
https://docs.python.org/3.4/whatsnew/3.4.html#other-language-changes

We only want the basename in the generated scripts.

Bug: angleproject:5516
Change-Id: Ia4009419ef627aa1ce12f9a944539c054edc3a6b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2720260
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2021-02-25 18:45:15 +00:00
Lubosz Sarnecki
37752956fd Generators: Use fixed year in license headers.
Remove dynamic year generation from generator scripts, as required by
the Chromium C++ style guide.
The dynamic year values were replaced by the current year at the time
the file was created according to git log. The code to dynamically
generate the year was removed.
This patch also refreshes generated files and hashes.

Bug: angleproject:5516
Change-Id: I735028bccb5c83217e92c380538f1abf0a906b2c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2690950
Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2021-02-23 17:17:12 +00:00
Jamie Madill
6af603e1e0 Vulkan: Secondary sort shader enums by name.
This preserves the primary sort by bits. If bits are equal we then
sort by name to produce a more stable sort.

Bug: angleproject:5653
Change-Id: I4cdbc21094fcbd1bb7ad17e124074949bdbf0439
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2704825
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2021-02-19 19:47:44 +00:00
Jamie Madill
7e990ef4bb Clean ups to generate_entry_points.
Switches to Python 3 support. Made a change to run_code_generation to
support this. Affects several generators. Also updates the generator
to make a few other small cleanups.

Bug: angleproject:5653
Change-Id: I045173c9ca85947c4eac22285701032c09f4c8d0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2699187
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2021-02-18 00:47:44 +00:00
Shahbaz Youssefi
939fcd1a14 Vulkan: Pass in emulated alpha value to ConvertVertex
In prepration for EXT_copy_image taking advantage of ConvertVertex.
Also a small optimization to this ALU heavy shader.

Bug: angleproject:5278
Change-Id: I6520391fe1af608db66f8c362f1038786b2c65e7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2556466
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2020-11-26 02:29:47 +00:00
Shahbaz Youssefi
6c1c3bd9d0 Vulkan: Clear depth by shader if depthClamp not supported
This will avoid breaking the render pass when clearing depth through
clearWithDraw if the depthClamp Vulkan feature is not present.

Bug: angleproject:4836
Change-Id: I845fd5074dd95f6896da89f9e119ebc5000a5688
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2462719
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
2020-10-10 05:01:55 +00:00
Shahbaz Youssefi
6f52192135 Vulkan: Use one triangle for full-screen utils
In tiling GPUs, using two triangles means the tiles intersecting the
seam would be processed twice.

Bug: angleproject:4936
Change-Id: Ib10b77e6ab15bba932f0e4e970e10ed5a8399cdd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2372623
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-09-26 20:34:19 +00:00
Geoff Lang
f0b020544c Add a Vulkan feature to compress float32 vertex formats.
Use the vertex conversion pipeline in VertexArrayVk to detect
static vertex data and convert float32 vertices to float16. This
feature is useful for determining if an allication is vertex
bandwidth bound and seeing what gains could be had by using smaller
attributes.

This feature could be implemented in ANGLE's frontend but new
infrastructure for converting and storing the converted attributes
would need to be added to gl::VertexArray. Our backends already
have the functionality needed to handle unsupported attribute formats
and this can be repurposed for compressing vertex formats.

Bug: b/167404532
Bug: b/161716126
Change-Id: I9a09656a72e8499faa4124adf876d7261c8341c9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2342285
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
2020-09-24 14:55:24 +00:00
Shahbaz Youssefi
0c25fbe3e3 Vulkan: Remove accidental padding in push constants
Bug: chromium:1124379
Change-Id: I45f4511c836858c70d4dae23c7b3954e0bc65ab4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2391616
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2020-09-03 01:44:41 +00:00
Shahbaz Youssefi
8adc54693b Vulkan: Generate mipmap in compute
An initial implementation based on AMD's FFX SPD (Single Pass
Downsampler).

Apart from requiring STORAGE_IMAGE support for the image format, the
following limitations are in place due to FFX SPD:

- Image must be 2D or 2D array (including cube maps)
- Image must be single-sampled

The following _can_ be supported, but not yet implemented:

- sRGB formats
- Integer formats
- depth/stencil formats

Bug: angleproject:4551
Change-Id: Ibc4d5cea701cca31e55e3d651540872bbd3b473f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2278713
Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2020-07-26 19:38:41 +00:00
Shahbaz Youssefi
95bfb3e5de Vulkan: Fix resolve draw path
If the draw path is taken for resolve, the internal shader previously
calculated (1+sum(sample.a))/sampleCount instead of
sum(sample.a)/sampleCount.  Additionally, due to a typo, the result was
rounded.

This change also fixes a number of off-by-one errors when calculating
src/dst offsets in blit/resolve path.

Tests are added to resolve from default to FBO and vice versa to
exercise the draw path which was otherwise never invoked for color
buffers.

Bug: angleproject:4746
BUg: angleproject:4092
Change-Id: I4b9c181339b89af44b27d61d27a6b3d88cde2eea
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2288224
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
2020-07-14 05:16:05 +00:00
Shahbaz Youssefi
36a97db1bb Vulkan: Compress internal shaders
Shaves ~200KB in binary size.  The compressed SPIR-V blobs are in most
cases a little smaller than 1/3 of the original size.

The internal shader blobs at this point take ~100KB.

Bug: angleproject:2022
Change-Id: I1a2cec073cb1f330632c8dce7a550a0cca1e373d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2280945
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-07-06 20:57:35 +00:00
Shahbaz Youssefi
d38c75c5ea Vulkan: Remove BufferUtils shader
This was the first internal shader written for prototyping UtilsVk.  It
ended up never having a user.

Bug: angleproject:2022
Change-Id: I846dcc216c4c018f5bda16ad67463f698b8e1c56
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2280944
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2020-07-03 18:46:33 +00:00
Ian Elliott
da3e6451c1 Vulkan: Fix fbo_invalidate tests for pre-rotation
The BlitFramebuffer path wasn't properly supporting stencil and MSAA
paths for pre-rotation:

1) The stencil path on Android isn't going through
   UtilsVk::blitResolveImpl, but requires changing
   UtilsVk::stencilBlitResolveNoShaderExport for rotation.

2) MSAA resolves requires rotating clippedSourceArea.

Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_\*
Bug: b/158337857
Change-Id: I092cab302c247ff9b2e262b12de3d1a56a257f8e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2269499
Commit-Queue: Ian Elliott <ianelliott@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
2020-06-26 18:58:22 +00:00
Ian Elliott
b067db752d Vulkan: Fix copySubImageImplWithDraw() for pre-rotation
This involves cases of copying from a rotated default framebuffer.
Various adjustments are needed for where the source is and its
relationship to gl_FragCoord in the custom ImageCopy fragment
shaders.  Various tests are affected, including the following:

Test: angle_deqp_gles2_tests --gtest_filter=dEQP.GLES2/functional_texture_specification_basic_copy*teximage2d_*
Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_texture_specification_basic_copy*teximage2d_*
Bug: b/158245571
Bug: b/157933235
Change-Id: Id9ec56d849cd2268954dd82623a7632a10fb8e8f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2248204
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Commit-Queue: Ian Elliott <ianelliott@google.com>
2020-06-26 16:47:45 +00:00
Shahbaz Youssefi
6ee18c2d01 Vulkan: Remove debug symbols from internal shaders
Shaves ~47KB on binary size.

Bug: angleproject:2022
Change-Id: Ifc861c4308a806d17f499bf2126009a59125b9f2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2249566
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-06-25 22:18:56 +00:00
Ian Elliott
70e706f43d Vulkan: Fix glBlitFramebuffer() for pre-rotation
This involves cases of blitting to/from a rotated default framebuffer,
potentially with scaling in one or both dimensions.  Various
adjustments are needed at different times in the stack, including in
the custom BlitResolve fragment shaders.  Various tests are affected,
including the following:

Test: angle_end2end_tests --gtest_filter=*EGLPreRotationLargeSurfaceTest.OrientedWindowWithBlitFramebuffer
Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_\*
Bug: b/158337857
Change-Id: Ibb176e4215784e85c0f34e6e1c22ba662517fed2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2242359
Reviewed-by: Ian Elliott <ianelliott@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Ian Elliott <ianelliott@google.com>
2020-06-24 13:18:48 +00:00
Jamie Madill
60672e7bf4 Update glslang_validator binary for Windows.
This binary was updated using update_glslang_binary.py.
Please see instructions in tools/glslang/README.md.

Bug: None
Change-Id: Idf76f16d7f05ce1642c27f087e40575806aa5d00
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2261232
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2020-06-23 17:02:58 +00:00
Shahbaz Youssefi
ce3d3413b3 Update glslang_validator binary for Linux.
This binary was updated using update_glslang_binary.py.
Please see instructions in tools/glslang/README.md.

Bug: None
Change-Id: Ib1c3ae292a90ec6aabc79b9396ca2e35007edc16
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2260573
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2020-06-23 16:04:14 +00:00
Shahbaz Youssefi
e7ae237eb9 Vulkan: ANGLE_copy_texture_3d support
Bug: angleproject:4748
Test: CopyTexImage*Vulkan:Texture3DCopy*Vulkan:Texture2DArrayCopy*Vulkan
Test: dEQP.KHR_GLES3/copy_tex_image_conversions_required_cubemap*cubemap*
Change-Id: Ifdc3d455ca8c9e732d0adf4afa9e2809d780ae18
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2246320
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-06-19 05:30:00 +00:00
Shahbaz Youssefi
b900f4e21c Vulkan: Use GPU path for copy to sRGB textures
To avoid creating aliasing views for sRGB textures, the ImageCopy
texture will do/undo sRGB transformation such that the final result is
as-if both source and destination views were linear.

Possible future optimizations:

- If either of source or destination has already been created with the
  MUTABLE flag, i.e. has a linear view already available, that can be
  used.
- If destination is sRGB but not renderable while its corresponding
  linear format is, and if the image is already created with the MUTABLE
  flag, using the linear view would allow the copy to go through the GPU
  instead of the CPU.

Bug: b/157934810
Bug: angleproject:4092
Change-Id: I43aaf882c90e1c60d0d9eb04636c203fc04090a4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2241622
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2020-06-16 18:49:05 +00:00
Shahbaz Youssefi
ac44f8c551 Vulkan: Apply SPIR-V optimization to internal shaders
Shaves about 40KB from binary size.

Bug: angleproject:2022
Bug: angleproject:3432
Change-Id: I008c18e0040b1bafe022087113681e2ace6eb7b8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1616963
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-06-12 02:23:09 +00:00
Shahbaz Youssefi
da980b40b2 Vulkan: Reduce ConvertVertex.comp variations
Handling RGB10A2 and A2BGR10 formats are made through dynamic flags.
One or two `if` checks (based on format) is not worth doubling the
number of shaders.

Shaves about 50KB from binary size.

Bug: angleproject:2022
Bug: chromium:1084580
Change-Id: Ia603a935b66d002dbacdee9342950ceed4042f86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2240672
Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2020-06-11 16:04:31 +00:00
Shahbaz Youssefi
d80747146e Vulkan: add autogen dependency to shader variations files
Bug: angleproject:3432
Change-Id: If16e5264d539c6a3944a60f4d28f4e6aa5420fe3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2235353
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-06-11 04:40:57 +00:00
Jamie Madill
f56e7227d8 Update glslang_validator binary for Windows.
This binary was updated using update_glslang_binary.py.
Please see instructions in tools/glslang/README.md.

Bug: None
Change-Id: I5949749ed704f55ecc8ef65789d665b1e8cf7af6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2238388
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
2020-06-09 18:38:43 +00:00
Shahbaz Youssefi
8a7b3d61c8 Update glslang_validator binary for Linux.
This binary was updated using update_glslang_binary.py.
Please see instructions in tools/glslang/README.md.

Bug: None
Change-Id: I1aed97de25baa3cb47ae81b63a70339a962d957d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2235361
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
2020-06-09 05:14:51 +00:00
Antonio Maiorano
98496cab72 Fix float to int copy in VK backend
This fixes WebGL tests on Vulkan (e.g. SwiftShaderVK) that copy from the
canvas (GL_RGBA8) to an integer format target texture, such as:
conformance2/textures/canvas_sub_rectangle/tex-2d-rg8ui-rg_integer-unsigned_byte.html
The sampled normalized value needs to be scaled up by 255.

Also fixes angle_end2end test CopyTextureTestES3.ES3UintFormats on
Vulkan.

Bug: b/156399229
Bug: angleproject:4092
Change-Id: I18d46bc4453fdc500caca96ca3a12fe93290b10c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2219142
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2020-05-29 14:58:10 +00:00
Xiaoxuan Liu
f8b2867816 Vulkan: Add support for VK_EXT_index_type_uint8
Enable VK_EXT_index_type_uint8 Vulkan extension if supported by
VkDevice.

Bug: angleproject:4405
Change-Id: I84d030497898c5944a36d9a88a31e7377ccd5e9e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2082391
Commit-Queue: Xiaoxuan Liu <xiaoxuan.liu@arm.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2020-03-03 16:24:14 +00:00