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>
Historically, compile flags were sent to the translator as a bitmask.
Recently, we were getting close to running out of bits. Additionally,
direct-to-metal work had started to introduce constants to be passed to
the translator, which were misplaced in ShBuiltInResources and Caps.
Recent work on Pixel Local Storage adds even more constants, aggravating
the situation.
In this change, the interface to passing compile flags is reworked. A
struct is passed (instead of a bitmask) that has one bit for each flag.
This can be indefinitely extended. Additionally, the constants needed
by metal and PLS are also placed in this struct. In turn, the backends
can set these options directly, and don't have to hack them into Caps to
further get hacked into ShBuiltInResources.
Bug: angleproject:7559
Change-Id: If93f1e1b8818ad3a0ac708ab04ab93b4b397d114
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812562
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
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>
This CL adds support for layout(yuv) in the shader, via a new
decoration.
The SPIRV decoration enum number is WIP and depends on final spec.
The decoration is only active if enabled via a flag in ShaderLang, which
will be connected with the feature supports_yuv_target in a future CL.
Bug: b/223456677
Change-Id: I29a724e689d1336a3e42c83d7afa944a11e07353
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3765890
Auto-Submit: Lingfeng Yang <lfy@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Plumbs through "GL_ANGLE_shader_pixel_local_storage" and
"GL_ANGLE_shader_pixel_local_storage_coherent" extension strings
advertised by ANGLE and stubs out an initial spec document. This change
doesn't add any new procedures or shader constructs, but it does allow
the PLS tests to start checking for the real extension strings and
requiring the GL_ANGLE_shader_pixel_local_storage extension.
Bug: angleproject:7279
Change-Id: I36877fe4117185a2121f803288123cd69a447cf3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3739590
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Chris Dalton <chris@rive.app>
Even when the dividend and divisor have the same value
some platforms do not return 1.0f. We need to emit sepcial
division code on such platforms.
Bug: angleproject:3586
Tests: KHR-GLES31.core.blend_equation_advanced.blend*HSL*
Change-Id: Ibb81f57c959ae2c8edb6d361bf6241c019dfb988
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3738439
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: mohan maiya <m.maiya@samsung.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
* Removed the Bresenham line raster emulation specialization
constant, along with related variables and functions.
Bug: angleproject:7366
Change-Id: If17c8ce9b459ad801bae8e887e5674bd9a3ff2bf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3680860
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
This change makes sure SPIR-V transformations are not required for depth
correction, having the number of potential pipelines.
Bug: angleproject:5881
Change-Id: If3f66b34bdd1127ae588cbc822ea7cf01fa8621f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3691801
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
As a specialization constant, it's impossible to predict the value the
drawable size may take, which in turn makes it impossible to warm up the
Vulkan pipeline cache at link time.
Bug: angleproject:7366
Change-Id: Ia3d1860a4fcb8e3078fdcb8d02a2e0cd173ea028
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3671976
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Previously 5 vec4s were used for driver uniforms + 2 vec4s if
specialization constants couldn't be supported.
The driver uniforms are rearranged and packed such that only 2 vec4s are
normally used, which include fallback for specialization constants as
well. In the future, most of the specialization constants may turn into
uniforms, and this change prepares for that.
Additional uniforms are used (3 vec4s) only if common extensions are
missing; transform feedback and bresenham lines.
This change makes it more practical for driver uniforms to be turned
into push constants. Additionally, these uniforms could potentially be
loaded and cached at the beginning of the shader for more efficient
memory access.
On Pixel6, with this change, the traces show no difference in wall time.
On most traces, CPU time shows up to ~7% improvement.
Bug: angleproject:7366
Change-Id: I0f47f863955af06a19c69d1f1d7c45b97d95476e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3668151
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
The specialization constant now only dictates whether x and y should be
swapped. The complete 8 possible states of rotation and y-flip are
achieved by using this swap in combination with a driver uniform for x
and y flip.
Swapping is still a specialization constant to avoid degrading
performance of dFdx/dFdy which otherwise would need both to be evaluated
instead of one. On platforms which don't support pre-rotation, the
specialization constant will never change and driver uniforms entirely
govern y-flip. On platforms that do support pre-rotation, only two
variations of the pipeline are needed.
Bug: angleproject:7366
Change-Id: I73f84e89fa9349d2098fa5b21573aee57d93a30c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3663151
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Lingfeng Yang <lfy@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
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>
On qualcomm, sometimes the output is ceil()ed instead of round()ed.
With ditering emulation affecting values, some dEQP tests fail due to
the excessive change in value when dithering bumps the value slightly
over to the next quantum.
In this change, a workaround is added to round() the value before
outputting it.
Bug: angleproject:6953
Change-Id: Iae7df5ca20055b4db3185c6153f3c0bf4ba07f68
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3611064
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Based on a change by Brandon Schade <b.schade@samsung.com>
In the translator, when advanced blend is enabled, an input attachment
is added. Based on the listed advanced blend equations, emulation code
is added that performs those equations' functions. The blend equation
itself is passed through a driver uniform.
Note that the advanced blend extension only allows a single output to
use advanced blend, and that should be at location 0.
In the Vulkan backend, when advanced blend is used, the driver uniform
to select the equation is updated and normal blending is disabled.
Bug: angleproject:3586
Change-Id: Icc42e8be238d34fca149087eb9cfe616a7643a6b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3575738
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Translator can accept the layout qualifiers for the advanced blend
equation. No emulation code is currently generated, and ANGLE will
initially rely on the corresponding Vulkan extension.
Based on change by Brandon Schade <b.schade@samsung.com>
Bug: angleproject:3586
Test: angle_unittests --gtest_filter=*KHRBlendEquationAdvanced*
Change-Id: I3b728c5f144386d7030bbbb301ddb07daa1492b9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3481309
Reviewed-by: Brandon Schade <b.schade@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Dithering in OpenGL is vaguely defined, to the extent that no dithering
is also a valid dithering algorithm. Dithering is enabled by default,
but emulating it has a non-negligible cost. Similarly to some other
GLES drivers, ANGLE enables dithering only on low-bit formats where
visual banding is particularly common; namely RGBA4444, RGBA5551 and
RGB565.
Dithering is emulated in the fragment shader and is controlled by a spec
constant. Every 2 bits of the spec constant correspond to one
attachment, with the value indicating:
- 00: No dithering
- 01: Dither for RGBA4444
- 10: Dither for RGBA5551
- 11: Dither for RGB565
The translator appends code to the shader that, based on the format
specified by the specialization constant, adds dithering to each color
attachment output. A 2x2 Bayer matrix is used for dithering, indexed by
gl_FragCoord.xy % 2.
Bug: angleproject:6755
Change-Id: Ib45da5938e299b6626bff921119d63e7357dd353
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3374261
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Writing to an unbound depth attachment is undefined behavior in Metal.
Fix this by emitting a function constant to guard depth buffer use
in fragment shaders.
Bug: angleproject:6865
Change-Id: Id7c10d0aeb349aacfe09c397bc292a71199ab50a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3380304
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
These are builtin uniforms removed in
https://github.com/KhronosGroup/WebGL/pull/3278
Decouple them from the original ANGLE_base_vertex_base_instance
extension.
Make a new ANGLE_base_vertex_base_instance_shader_builtin
extension for these builtin uniforms.
Bug: angleproject:3402
Change-Id: I77b93917976ce435db9c578c0ade37bff18a42b0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3290304
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
This reverts commit 701e8892f4.
Reason for revert: Chromium dependency fixed in http://crrev/c/3214440
Original change's description:
> Translator: Remove the SH_VALIDATE flag
>
> The SH_VALIDATE flag is a noop, defined as zero (0).
>
> Also move option descriptions up in the file.
>
> Bug: angleproject:6501
> Change-Id: I898106eb68b4508d8f94534cbff66652a69f4f3e
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3207360
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Bug: angleproject:6501
Change-Id: I4d1514d6ac04e5bedf3624facf8e9339828fa291
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3229955
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
The SPIR-V gen path is now made default. Compilation through glslang is
still supported for debugging, and is enabled on the GLSL* end2end tests
for smoke testing. On release builds, glslang is not supported.
To test with glslang, add the following gn arg (only necessary if dcheck
is disabled):
angle_enable_spirv_gen_through_glslang = true
Then enable the generateSPIRVThroughGlslang feature. This can be done
by setting an environment variable:
ANGLE_FEATURE_OVERRIDES_ENABLED=generateSPIRVThroughGlslang ./angle_deqp_gles2_tests
Binary size saving:
- 1.3MB on Linux (SPIR-V gen itself: 240KB)
- 730KB on Android (SPIR-V gen itself: 140KB)
Perf tests:
- LinkProgramBenchmark.Run/vulkan_compile_single_thread
* Through glslang:
truncated mean: 1287033.36
* Direct SPIR-V Gen:
truncated mean: 244495.91 (~80% reduction)
- LinkProgramBenchmark.Run/vulkan_compile_multi_thread
* Through glslang:
truncated mean: 4565894.83
* Direct SPIR-V Gen:
truncated mean: 1158164.10 (~75% reduction)
Bug: angleproject:4889
Bug: angleproject:6210
Change-Id: I486342702977c8114e90073b97183aba115a8b2d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3115140
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
This reverts commit 4ca3d7d643.
Reason for revert: breaks roll into Chromium crrev.com/c/3213239
SH_VALIDATE is used in gpu_unittests.
Original change's description:
> Translator: Remove the SH_VALIDATE flag
>
> The SH_VALIDATE flag is a noop, defined as zero (0).
>
> Also move option descriptions up in the file.
>
> Bug: angleproject:6501
> Change-Id: I898106eb68b4508d8f94534cbff66652a69f4f3e
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3207360
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Bug: angleproject:6501
Change-Id: Ia9983eac58a07e2a6e3d5fe4d1bfccfb9c48ccd0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3212709
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
The SH_VALIDATE flag is a noop, defined as zero (0).
Also move option descriptions up in the file.
Bug: angleproject:6501
Change-Id: I898106eb68b4508d8f94534cbff66652a69f4f3e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3207360
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
This CL merges in the ANGLE changes between these two WebKit commits:
https://git.webkit.org/?p=WebKit.git;a=commit;h=8648b353ab1d7730438c2e08319e1a4d64982c31https://git.webkit.org/?p=WebKit.git;a=commit;h=166e4924a52971d6a32ad48247a439b16c00e062
Include provoking vertex buffer out of bounds fix
from https://bugs.webkit.org/show_bug.cgi?id=230107
Fix bad merge of resetting of dirty bits, breaking
DepthStencilFormatsTest.DepthTextureRender test and perhaps others.
Disable GL_APPLE_clip_distance when the direct-to-Metal compiler is
active. It can not yet handle the gl_ClipDistance array.
Disable use of rectangular textures for IOSurfaces. Metal can bind
IOSurfaces to 2D textures, and this was passing all tests in the
SPIR-V Metal backend. Introducing rectangular textures breaks the
SPIR-V Metal backend, and the tests currently fail on the
direct-to-Metal backend.
Fix several bugs with ProvokingVertex, which was causing
both the SpirV and Direct backends to incorrectly draw
indices.
(https://bugs.webkit.org/show_bug.cgi?id=230107)
Skip the following tests on the Metal backend which is still failing
RobustResourceInitTestES3.BlitDepthStencilAfterClearBuffer
GLSLTest_ES3.GLVertexIDIntegerTextureDrawArrays/ES3_Metal
With these changes, angle_end2end_tests again runs to completion.
Bug: angleproject:6395
Change-Id: I3cc58f531426a95fc8f177a4ad87f56c1855a546
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3167010
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kyle Piddington <kpiddington@apple.com>
- Uses more common toString methods instead of custom ones.
- Uses enum to string in more places intsead of numeric enums.
- Adds missing group scopes in several places.
- Skips serializing empty image levels.
Bug: angleproject:5133
Change-Id: I2c9523981aba4ec0afb5f0623cb34154db263e6b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3097805
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 <kbr@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This workaround was implemented for a bug in Nvidia driver 387 which is
end-of-life. More recent driver branches (390 and 4XX) are fixed, and
so this workaround is no longer required. The implementation of the
workaround itself could introduce bugs.
Bug: chromium:772651
Bug: chromium:1201084
Change-Id: I3db179eb90d9124235bdad2daacc712302906d8e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3067952
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
In GLSL, these values are semantically copied when passed to a function
as an in or inout parameter. For example in:
bool f(inout vec4 a, inout vec4 b)
{
a = vec4(0);
return all(equal(a, b));
}
var = vec4(1);
bool result = f(var, var);
result is expected to be false. In SPIR-V, every parameter is
semantically passed by "reference".
glslang conservatively uses temporaries to pass to functions. An
optimization in ANGLE didn't create temporaries for unindexed lvalues,
which did not take into account the above fact. This optimization is
limited to out parameters now.
Bug: angleproject:4889
Change-Id: Ie1b4b1cecba847ba63d5810d01d0856823b89ddc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3046103
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
In preparation for a Chromium change that makes dchecks enabled
by default in Release builds, we'll keep ASSERT disabled in
Release by default. We add a new flag 'angle_assert_always_on'
for controlling ANGLE ASSERT behaviour.
Also slightly refactors the direct SPIR-V generation GN.
Chromium CL: https://crrev.com/c/2893204
Bug: chromium:1225701
Change-Id: I01a6def28d7c21e771e9800889a6b9c274972de2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3035447
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Loops are similar to if-else in that they generate a number of blocks
where the first block specifies divergence (OpLoopMerge) and the merge
block. Differently from if-else, there is a block where the condition
is evaluated and a block which `continue;` leads to (this last block is
the only one allowed to back-jump to the beginning of the loop).
Bug: angleproject:4889
Change-Id: Ic59f4bf3e05fbf93cb5af85acd3bc4b0da8412af
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2957809
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
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 <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This is a reland of a474fd7de7
The integer clamp used in this transformation is not available in es100
shaders, and float clamp is used instead.
Original change's description:
> Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation
>
> This translator flag adds a clamp to non-literal indices to arrays. Two
> strategies were provisioned, using the clamp intrinsic or a hand-written
> function. The latter is ununsed in angle, chromium, firefox and
> webkit, so this change removes this option and uses the clamp intrinsic
> unconditionally.
>
> The clamp itself was added at output generation time with special flags
> set on the index node. This is changed such that a proper AST
> transformation is done and no-special handling would be necessary.
>
> Bug: angleproject:4361
> Bug: angleproject:4889
> Change-Id: Ieccfd2c1c347563fb5282e9fa66d39304e62f2ca
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935041
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Bug: angleproject:4361
Bug: angleproject:4889
Change-Id: I9397ec7e6bdfb706c2a891b33fd3b2b79e883ccc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2940902
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
This reverts commit a474fd7de7.
Reason for revert: breaks GLES2ConformTest, see roll into Chromium:
https://chromium-review.googlesource.com/c/chromium/src/+/2935093
Original change's description:
> Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation
>
> This translator flag adds a clamp to non-literal indices to arrays. Two
> strategies were provisioned, using the clamp intrinsic or a hand-written
> function. The latter is ununsed in angle, chromium, firefox and
> webkit, so this change removes this option and uses the clamp intrinsic
> unconditionally.
>
> The clamp itself was added at output generation time with special flags
> set on the index node. This is changed such that a proper AST
> transformation is done and no-special handling would be necessary.
>
> Bug: angleproject:4361
> Bug: angleproject:4889
> Change-Id: Ieccfd2c1c347563fb5282e9fa66d39304e62f2ca
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935041
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Bug: angleproject:4361
Bug: angleproject:4889
Change-Id: I911cfe0199b04dbc3d6d4265775b6c2de00a9777
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2937024
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
This translator flag adds a clamp to non-literal indices to arrays. Two
strategies were provisioned, using the clamp intrinsic or a hand-written
function. The latter is ununsed in angle, chromium, firefox and
webkit, so this change removes this option and uses the clamp intrinsic
unconditionally.
The clamp itself was added at output generation time with special flags
set on the index node. This is changed such that a proper AST
transformation is done and no-special handling would be necessary.
Bug: angleproject:4361
Bug: angleproject:4889
Change-Id: Ieccfd2c1c347563fb5282e9fa66d39304e62f2ca
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935041
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This change is meant to merge the translator changes from Apple's
direct-to-Metal backend. Taken from Kyle Piddington's CL:
https://chromium-review.googlesource.com/c/angle/angle/+/2857366/
The goal of this CL is to merge the translator code in a state that
compiles, but not to switch the Metal backend over to use this
translator backend yet.
Bug: angleproject:5505
Change-Id: I68a6354604498cd5fd1eb96c13fc56f3b38f2bd0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897536
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
This is the first change in a series to generate SPIR-V directly from
the translator's AST, instead of the generating text GLSL and feeding it
to glslang.
This change implements the majority of the work needed to map AST types
to SPIR-V types, and declare types and interface variables in SPIR-V.
Additionally, it lays the infrastructure to conditionally enabling this
path in end2end tests.
No tests are currently enabled as the change doesn't actually generate
code for function bodies yet.
Bug: angleproject:4889
Change-Id: Iacb28b6907fd48c50e4cc5a0e7ad72f6eed241d4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2889603
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
SH_DONT_PRUNE_UNUSED_FUNCTIONS was only used by tests, and never used by
ANGLE or chromium.
Bug: angleproject:4889
Change-Id: I4926f86125e69b07e9d4d95134b7b70522e0d64f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2607491
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
With this change, the ANGLE translator immediately compiles the
generated GLSL into SPIR-V with glslang and discards the source. This
is in preparation for generating SPIR-V directly, by making the frontend
and backend already able to digest it.
This change also allows the expensive glslang calls to be parallelized,
improving the following perf test by about 20%:
LinkProgramBenchmark.Run/vulkan_compile_and_link_multi_thread
Previously, the test was run as such in the Vulkan backend:
Main Thread 1 Thread 2
Compile1 --->
Compile2 --------------------->
Translator Translator
<---
<---------------------
Link
glslang
for
shader1
glslang
for
shader2
Done
With this change, it is run as such:
Main Thread 1 Thread 2
Compile1 --->
Compile2 --------------------->
Translator Translator
glslang glslang
<---
<---------------------
Link
Done
glslang_wrapper_utils no longer interacts with glslang! A rename will
follow.
Bug: angleproject:4889
Change-Id: If4303e8ba0ba43b1a2f47f8c0a9133d0bee1a19a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2721195
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
ShaderVariable's functions and members are all mixed up. This CL
reorders things to move the functions before the members, to better
match ANGLE's coding style.
This also adds a note that any new members that are added need to be
added to gl::WriteShaderVar() and gl::LoadShaderVar(), which are
actually implemented in Program.cpp, since ShaderVars.h/cpp can't
include libANGLE/BinaryStream.h. There are currently several members
that are missing, leading to save/load errors, which are fixed in a
follow-on CL in this chain.
Bug: b/182409935
Change-Id: I1381a5efffb56c0989961bbcfd405b95d59d6396
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2770682
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
This change moves the code generation at link time from source code to
SPIR-V. As a result, transform feedback extension and emulation paths
are more similarly handled before SPIR-V transformation (they both store
information identically in the ShaderInterfaceVariableInfoMap).
This change gets rid of the @@ XFB-OUT @@ marker. With no source code
generation at link time, shader compilation can be moved to
glCompileShader time.
Bug: angleproject:4888
Change-Id: I8cdb89c22b57ce48cf5d226b8e41622d9d550d46
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2713269
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
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>