|
2795866c
|
2021-09-10T02:08:40
|
|
Fix ConvertUnsupportedConstructorsToFunctionCalls
The code was not hanlding nested expressions. For example:
mat4(vec4(mat2x2), ...)
Switched to using TIntermRebuild
Bug: angleproject:5505
Change-Id: I845d94326324ac48d7489225d42d0c6e38622492
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3152168
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
fa9f4cf3
|
2021-09-08T12:58:59
|
|
Fix AST validation error with gl_FragCoord
Bug: angleproject:6370
Change-Id: Ia575e0329da74c84365b74b39398551b572b91a5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3149725
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Gregg Tavares <gman@chromium.org>
|
|
e02753fc
|
2021-08-31T21:09:45
|
|
Convert constructors to function calls where needed.
MSL does not do as many conversions between types
and has more strict constructors than GLSL so
convert to function calls where necessary.
Fixes:
GLSLTest_ES3.AmbiguousConstructorCall2x2/ES3_Metal
GLSLTest_ES3.AmbiguousConstructorCall2x3/ES3_Metal
GLSLTest_ES3.ConstructMatrixFromNonFloat/ES3_Metal
GLSLTest_ES3.ConstructNonFloatVectorFromMatrix/ES3_Metal
GLSLTest_ES3.ScalarConstructor/ES3_Metal
UniformBufferTest.Std140UniformBlockWithRowMajorQualifier/ES3_Metal
UniformBufferTest.Std140UniformBlockWithPerMemberRowMajorQualifier/ES3_Metal
UniformBufferTest.Std140UniformBlockWithPerMemberColumnMajorQualifier/ES3_Metal
UniformBufferTest.Std140UniformBlockWithRowMajorQualifierOnStruct/ES3_Metal
SimpleUniformTest.FloatMatrix2UniformStateQuery/ES2_Metal
SimpleUniformTest.FloatMatrix2UniformStateQuery/ES3_Metal
SimpleUniformTest.FloatMatrix3UniformStateQuery/ES2_Metal
SimpleUniformTest.FloatMatrix3UniformStateQuery/ES3_Metal
SimpleUniformTest.ArrayOfMat3UniformStateQuery/ES2_Metal
SimpleUniformTest.ArrayOfMat3UniformStateQuery/ES3_Metal
UniformTestES3.MatrixArrayUniformStateQuery/ES3_Metal
Bug: angleproject:6306
Change-Id: Iea8a9a261f94f121f482c2ea9678192ca056570c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3134963
Commit-Queue: Gregg Tavares <gman@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
|
|
9d0e2851
|
2021-09-01T00:42:58
|
|
Fix SeparateDeclarations vs struct specifiers
Bug: chromium:1237696
Change-Id: I3b00f3797800e814ca83226a8e4f25b2a43cc641
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3133824
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
3408ea3e
|
2021-08-24T11:41:42
|
|
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 <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
800e82c6
|
2021-08-23T11:05:23
|
|
Translator: Validate precisions
When declaring a variable, a struct field, function parameter etc,
there's a precision necessarily applied to the entity being declared.
AST Validation is added to enforce this. Intermediate nodes derive
their precision from these entities automatically.
Consistency of intermediate nodes is not validated. This is because AST
transformations replace a node with a transformed one, and that may not
have the same precision. Take the following code:
mediump float x = ...;
mediump float y = ...;
... x + y ...
and assume is transformed as such:
highp float driver_uniform;
... (x * driver_uniform) + y ...
The addition was originally done in mediump, but would seemingly need to
be done in highp after transformation. There are a number of options
here:
- Make sure that when nodes are replaced, the precision is unaffected.
This can be intrusive, requiring temp variables.
- Bubble up the new precision
- Accept the discrepancy
ANGLE opts for the last option, which actually respects the original
shader's intended precision for operations, even if some transformation
needs to temporarily evaluate an expression at a higher precision.
Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: Ibcde3a230de159157783b1c6d5ef1cd63ceb4d8f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3114027
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
210773db
|
2021-08-05T10:41:59
|
|
Translator: Be more explicit about precisions
GLSL ES requires that every symbol (variable, block member, function
parameter and return value) is appropriately qualified with a precision,
either individually or through the global precision specifier.
Some tree transformations however produced symbols with EbpUndefined
precision. In text GLSL output, these would produce unqualified symbols
which was often incorrect.
In this change, the transformations are made to produce explicit / more
consistent precisions. The validation (that caught these issues) is not
included in this change as there are still a few corner cases left to
address.
Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: Icca8a0a5476f8646226e7243aa8f501f44acc164
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3075127
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
63bb0e53
|
2021-08-16T16:30:32
|
|
Add depth fix to convert from GL to Metal
Vertex shaders need to convert from GL's -1 to +1 z range
to Metal's 0 to +1 z range with:
z = (z + w) * 0.5
This code is being upstreamed from WebKit.
It fixes these end to end tests.
BlitFramebufferTest.MultisampleDepthClear/ES3_Metal
BlitFramebufferTest.MultisampleDepthClear/ES3_Metal_NoStencilOutput
BlitFramebufferTest.BlitDepthStencilPixelByPixel/ES3_Metal
BlitFramebufferTest.BlitDepthStencilPixelByPixel/ES3_Metal_NoStencilOutput
ClearTest.ClearStencilMask/ES2_Metal
ClearTest.ClearStencilMask/ES3_Metal
ClearTestES3.ClearMultipleAttachmentsIndividually/ES3_Metal
ClearTestES3.MaskedClearHeterogeneousAttachments/ES3_Metal
ClearTestES3.ScissoredClearHeterogeneousAttachments/ES3_Metal
ClearTestES3.ClearBufferivStencilMask/ES3_Metal
ClearTestES3.ClearBufferfiNoStencilAttachment/ES3_Metal
MaskedScissoredClearTest.Test/ES2_Metal__clear_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_s_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_s_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_d
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_d
MaskedScissoredClearTest.Test/ES2_Metal__clear_ds
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_ds
MaskedScissoredClearTest.Test/ES2_Metal__clear_ds_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_ds_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_cs
MaskedScissoredClearTest.Test/ES2_Metal__clear_cs_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cs_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_cd
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cd
MaskedScissoredClearTest.Test/ES2_Metal__clear_cds
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cds
MaskedScissoredClearTest.Test/ES2_Metal__clear_cds_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cds_mask_s
MaskedScissoredClearTest.Test/ES2_Metal__clear_cs_mask_cs
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cs_mask_cs
MaskedScissoredClearTest.Test/ES2_Metal__clear_cd_mask_c
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cd_mask_c
MaskedScissoredClearTest.Test/ES2_Metal__clear_cds_mask_c
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cds_mask_c
MaskedScissoredClearTest.Test/ES2_Metal__clear_cds_mask_cs
MaskedScissoredClearTest.Test/ES2_Metal__scissored_clear_cds_mask_cs
MaskedScissoredClearTest.Test/ES3_Metal__clear_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_s_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_s_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_d
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_d
MaskedScissoredClearTest.Test/ES3_Metal__clear_ds
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_ds
MaskedScissoredClearTest.Test/ES3_Metal__clear_ds_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_ds_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_cs
MaskedScissoredClearTest.Test/ES3_Metal__clear_cs_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cs_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_cd
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cd
MaskedScissoredClearTest.Test/ES3_Metal__clear_cds
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cds
MaskedScissoredClearTest.Test/ES3_Metal__clear_cds_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cds_mask_s
MaskedScissoredClearTest.Test/ES3_Metal__clear_cs_mask_cs
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cs_mask_cs
MaskedScissoredClearTest.Test/ES3_Metal__clear_cd_mask_c
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cd_mask_c
MaskedScissoredClearTest.Test/ES3_Metal__clear_cds_mask_c
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cds_mask_c
MaskedScissoredClearTest.Test/ES3_Metal__clear_cds_mask_cs
MaskedScissoredClearTest.Test/ES3_Metal__scissored_clear_cds_mask_cs
DepthStencilFormatsTest.DepthTextureRender/ES2_Metal
DepthStencilFormatsTest.DepthBuffer16/ES2_Metal
DepthStencilFormatsTest.DepthBuffer24/ES2_Metal
DepthStencilFormatsTest.VerifyDepth32UploadData/ES2_Metal
DepthStencilFormatsTest.VerifyDepth16UploadData/ES2_Metal
TinyDepthStencilWorkaroundTest.DepthTexturesStick/ES3_Metal
DiscardFramebufferEXTTest.ClearDepthThenDrawWithDepthTestThenDiscard/ES2_Metal
DiscardFramebufferEXTTest.ClearDepthThenDrawWithDepthTestThenDiscard/ES3_Metal
Bug: angleproject:5505
Change-Id: I9b52bb46569678636afc6a243bfa8779f101b6af
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3097161
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
|
|
061188a7
|
2021-08-04T10:07:47
|
|
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 <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
1ce78397
|
2021-07-30T16:51:45
|
|
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 <kbr@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
ebe943e2
|
2021-07-29T11:19:33
|
|
Vulkan: SPIR-V Gen: Fix gl_Clip/CullDistance
These built-ins can be redeclared in the shader. The translator took
these redeclarations (and gl_LastFragData) as UserDefined symbols.
There were a number of hacks such as in name generation and
CollectVariables, to special-case these redeclarations.
This change instead makes sure that these variables continue to be
considered built-ins with the appropriate qualifiers. A number of fixes
are made accordingly:
- Hacks are removed.
- In fragment shaders, ANGLEClipDistance was initialized with
gl_ClipDistance for further use by the shader. The code generation
however mistakenly produced `gl_ClipDistance[0] =
ANGLEClipDistance[0];`, which caused compilation failures by glslang,
but passed the tests accidentally because they expected link failures
(see next item).
- CollectVariables is fixed to correctly collect gl_Clip/CullDistance
in fragment shaders; previously they were collected as output
varyings, and therefore the aforementioned link error was not produced
in the tests after the compilation error was fixed.
Additional fixes:
- The transformation of gl_Clip/CullDistance was always ever done on one
of them due to misplaced breaks in the loop that detected their
presence.
- The transformation of gl_CullDistance was skipped when it was not
redeclared.
Validation is added to make sure these built-ins always have the correct
qualifier even when redeclared. SPIR-V gen support for these variables
have been fixed as well.
Bug: angleproject:4889
Change-Id: Ic8bf2c508357035cb937ef41a28ae22ffc533ebe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3059921
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
aec5e65c
|
2021-07-28T00:36:12
|
|
Get direct-to-Metal backend to run angle_end2end_tests.
Cherry-pick nameless struct fix from Apple in
https://bugs.webkit.org/show_bug.cgi?id=227482 .
Fix SeparateCompoundStructDeclarations pass to stop generating
multiple declarations; thanks syoussefi@ for advice.
Incorporate additional passes from TranslatorVulkan
(MonomorphizeUnsupportedFunctionsInVulkanGLSL,
RewriteArrayOfArrayOfOpaqueUniforms,
SeparateStructFromUniformDeclarations) needed by RewriteStructSamplers
pass in TranslatorMetalDirect. Fixes many assertion failures in GLSL
tests. Moved these passes out of tree_ops/vulkan. Thanks again to
syoussefi@ for advice and help.
Disable a validation check related to the RewritePipelines pass. Skip
two tests that were failing for other reasons.
With these changes, angle_end2end_tests runs to completion when the
direct-to-Metal backend is turned on. There are still ~1300 failures
of the ~4000 tests which will be investigated next.
Bug: angleproject:5505
Change-Id: Ibca77822543e8e8e8d2a8c862e92cdf74bfa3545
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3058524
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
|
|
b8d6f8aa
|
2021-07-22T22:31:29
|
|
Translator: Facilitate integration in FireFox
Instead of relying on is_apple to build workarounds applied on apple
hardware, a new build argument is added for this purpose. This allows
FireFox to more easily include these files in their build system (which
builds every workaround on every platform).
The workarounds are reorganized too and moved from tree_ops/gl/mac to
tree_ops/apple. RewriteRowMajorMatrices is moved there too as it's now
used by both gl and metal. This workaround is large, and removing it
from non-apple builds improves binary size (~40KB on Linux).
Bug: angleproject:6188
Change-Id: I8e1dab44d0235bb6b8341d53721bdd0d157d46c6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3047385
Reviewed-by: Jeff Gilbert <jgilbert@mozilla.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
a3df80ea
|
2021-07-19T17:15:13
|
|
Translator: Validate AST consistency w.r.t function calls
This ensures that tree transformations don't create invalid function
calls. Additionally, it's validated that no raw function calls are
issued, as that's deprecated.
Bug: angleproject:4889
Change-Id: Iabbb493dcc0a5654bbb5f930e402bf3492c89979
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3040119
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
|
|
b3cbfd55
|
2021-07-07T12:31:57
|
|
Fix multiple end2end crashes in direct-to-MSL compiler.
This set of changes:
- Adds a single place (CompilerMtl::useDirectToMSLCompiler) where the
direct-to-MSL compiler can be enabled, still at compile time rather
than run time. It is still disabled by default.
- Initializes MTLWaitableCompileEventImpl::mShader, without which all
shader compiles crash.
- Fixes a mismatch of the ANGLERasterizerDisabled variable name in
the generated MSL.
- Removes the transform feedback bindings as an argument to the
vertex shader's main0(). Transform feedback support needs to be
reimplemented in this compiler backend.
- Added an option to the DriverUniform class to emit as either an
interface block or a struct. The direct-to-MSL backend assumes it
is a struct.
- Disable variable reference validation when referencing either
sample mask or rasterizer discard functionality in the shader.
- Disable struct usage validation when inserting references to
ANGLE_TextureEnv. This occurs during pipeline rewriting and it's
infeasible to disable it at that point, so disable it during
pipeline rewriting - which means it's disabled for all shaders.
- For angle_end2end_tests, disable the file API hooking which
disables the Metal shader cache. This speeds up the tests
significantly - by roughly a factor of 5.
With these changes, several hundred angle_end2end_tests run without
any assertion failures, though still with many test failures. The next
crash is in:
GLSLTest.NamelessScopedStructs/ES2_Metal
and will likely require a larger bug fix, or more changes to be
upstreamed from WebKit's repository.
Bug: angleproject:5505
Change-Id: Ia1ea9a13867f00035d4aeccf907fd032255588e3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3010486
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
|
|
d33a2222
|
2021-04-26T16:56:15
|
|
Upstream Apple's direct-to-Metal backend: compile libANGLE.
This change is meant to merge the metal backend 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 metal backend code in a state
that compiles, but not to switch the Metal backend over to using
the direct-to-metal backend yet.
Bug: angleproject:5505
Bug: angleproject:6127
Change-Id: If6783e06e0086b3a1dd25c6f53caca5cfc96cb86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950067
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
|
|
af1eed2e
|
2021-06-10T01:55:59
|
|
Vulkan: Generate gl_FragColor/Data declarations in AST
gl_FragColor and gl_FragData are not available in Vulkan. Prior to this
change, their declaration as webgl_FragColor and webgl_FragData was done
in text. This change implements an AST transformation that declares a
normal fragment output variable and replaces all references to these
built-ins with those variables.
Bug: angleproject:4889
Change-Id: If224e089dec25e4aa580beb135e1be2890de7887
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2953042
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
d7aa0130
|
2021-04-26T16:56:15
|
|
Upstream Apple's direct-to-Metal backend: compile translator.
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>
|