This will make mocking easier for unit testing ResourceManager.
BUG=angleproject:942
Change-Id: I24b9d0be550991845225141d6e7d5630383a8718
Reviewed-on: https://chromium-review.googlesource.com/258901
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Same as for unpack, this allows us to pass through the state reset
code of dEQP without UNIMPLEMENTED errors, while still throwing
asserts if they are set to non-default values.
BUG=angleproject:901,angleproject:512
Change-Id: I0ce0258b0e91eb83c066c241693aaa5c164b2989
Reviewed-on: https://chromium-review.googlesource.com/257131
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Move the UNIMPLEMENTED checks to where they are used with non-default
values. This allows dEQP to pass the prerequisite tests like state
reset without throwing assertion failures in debug.
BUG=angleproject:901,angleproject:512
Change-Id: I3bd35f6dea61e7d80d1379ba4e8e13437e68431a
Reviewed-on: https://chromium-review.googlesource.com/257130
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This reverts commit f8dc4fb66d.
The special state to track field selection is actually necessary to avoid
reduce/reduce conflicts when array constructors are added to the grammar.
BUG=angleproject:941
TEST=WebGL conformance tests, angle_unittests
Change-Id: I55476483c9e83241e8978cd58f05ef303c7c8680
Reviewed-on: https://chromium-review.googlesource.com/260260
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
This class helps make mocking easier for unit tests.
Also update the back-end generator script.
BUG=angleproject:942
Change-Id: Ib0cee2b40c3a0faaac32b22c986b824b7b2dddde
Reviewed-on: https://chromium-review.googlesource.com/258900
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This legacy struct duplicates some methods in the gl::State. We
can restrict its use to D3D and on newer back-ends use the State
directly.
BUG=angleproject:930
Change-Id: I2c298e76b072ee73f2b3e17f6696693031ce1f91
Reviewed-on: https://chromium-review.googlesource.com/258070
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Adding array built-ins like gl_FragData and gl_LastFragData to the
symbol table with a name that included their size in brackets was
incorrect and unnecessary. Remove this. The array built-ins should only
be added with their proper name and with an array type.
Also refactor the code to reduce unnecessary repetition of conditions.
The previous version attempted to split the built-ins that had
dependencies on resources into their own part of the code, but this split
was not clearly defined and only made the code harder to follow and
prone to issues.
TEST=WebGL conformance tests
Change-Id: I7a77865a594864a22f3b566f9d3da1d0ead46466
Reviewed-on: https://chromium-review.googlesource.com/258751
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Fix indentation of case labels, fix too long lines, put braces on their
own lines and remove extraneous spacing and comments that didn't
contribute to the readability of the code.
TEST=WebGL conformance tests
Change-Id: Ie33d0a7c4412c448081f5d879fa9f64baaf8d537
Reviewed-on: https://chromium-review.googlesource.com/258750
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
ANGLE's ESSL3 built-in function isnan() implementation just uses HLSL
intrinsic function isnan(). For HLSL intrinsic function isnan() to work
properly, IEEE strictness needs to be enabled for D3D compiler.
This change detects use of isnan() in shaders and passes compiler flag
D3DCOMPILE_IEEE_STRICTNESS whenever isnan is used in shaders. This
change also moves existing workarounds in D3DWorkaroundType to
D3DCompilerWorkarounds.
BUG=angle:927
TEST= dEQP tests
dEQP-GLES3.functional.shaders.builtin_functions.common.isnan.*
Change-Id: I1ce5b1a7a825fdd720a37dc9aeb71320e55162d9
Reviewed-on: https://chromium-review.googlesource.com/255834
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Jamie Madill <jmadill@chromium.org>
This is useful for dumping live objects on exit, to debug resource leaks.
Change-Id: Ie88787defa37853d0a33c951b107ceac289e58df
Reviewed-on: https://chromium-review.googlesource.com/256461
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Now that libANGLE is cross-platform, this should work on OSX/Linux
and Android. Includes a warning fixes for test comparisons, and fix
to our META_ASSERT wrapper macro for clang.
BUG=angleproject:773
Change-Id: I6b88a85c62a2e07734ae81fb8276c28c5f8f9f47
Reviewed-on: https://chromium-review.googlesource.com/258300
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This encapsulates the workaround in the D3D renderer, and also
optimizes the workaround to only compute a new set of attachments
when there is a change to the state.
BUG=angleproject:930
Change-Id: Ibdc15078236e2d19b544fae8e65b7f2554f31844
Reviewed-on: https://chromium-review.googlesource.com/254102
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
With the new shared state structure, we can eliminate a lot of the
state tracking within the FramebufferD3D implementation.
BUG=angleproject:930
Change-Id: I0953e321bae3afe7cde7b73c55af62546665c890
Reviewed-on: https://chromium-review.googlesource.com/254101
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This patch introduces a new Framebuffer::Data class, which stores
attachment related state. This will eliminate the need to store
duplicated state between the classes.
BUG=angleproject:930
Change-Id: I80de4db39ab99d623b0ad8306bf3cbb794cd8bd5
Reviewed-on: https://chromium-review.googlesource.com/254100
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
The caps structure can often give a lower and faster bound, as well
as being more general. We should gradually move away from the
implementation limits.
BUG=angleproject:930
Change-Id: I979472cdb6f59c6f0cc0c80f1c29c51295872bea
Reviewed-on: https://chromium-review.googlesource.com/256731
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This was the only field not initialized by the constructor, which
looks like an oversight.
Change-Id: If61424d574c663113a4c6d31e94b6ec13b412884
Reviewed-on: https://chromium-review.googlesource.com/257360
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
We were not calling eglTerminate to clean up.
Change-Id: I022d8158c6dc041664d4b9c01295a67c9760b245
Reviewed-on: https://chromium-review.googlesource.com/256730
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Matrix compound multiplication was lacking transposes. Add them so that
results match normal multiplication.
BUG=angleproject:938
TEST=dEQP-GLES3.functional.shaders.matrix.mul_assign.*
Change-Id: I4c5159de0727afb4ee2831586f04fa817619de7a
Reviewed-on: https://chromium-review.googlesource.com/256366
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
The emulation is already toggled by a compilation flag, so having it
behind an ifdef only adds unnecessary complexity, particularly when
testing changes to the emulation code.
BUG=angleproject:865
Change-Id: Idf7854c2b5323609880b527ed806440dcc8ac091
Reviewed-on: https://chromium-review.googlesource.com/256365
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
This will allow us to properly layer the isolate dependencies
within Chromium. Now that ui/gl will depend on libGLESv2 on
Windows, and other platforms to come, most everything will
need to have the ANGLE libraries bundled.
BUG=436191
Change-Id: Ifa6c87d3b7840bfbbd4830b218b6d3524258fe12
Reviewed-on: https://chromium-review.googlesource.com/254063
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
This moves GLSL output specific code from the Compiler class to the
GLSL/ESSL translators.
BUG=angleproject:865
Change-Id: I2d552e9cdb41f7d8ddfee7b0249a99d629a6d7d7
Reviewed-on: https://chromium-review.googlesource.com/255471
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
A test was checking that if we have less than 4 channels, and no
GL_EXT_texture_rg, we would expect an invalid operation.
Now that we don't expose GL_EXT_texture_rg on DX9, this is firing, and
I believe incorrectly. I've changed the condition to test for less than
3 channals, since RGB -> RGB should work fine without texture_rg
support.
Change-Id: I9955b143c37df9762e0ef45c987581fab2bbcef0
Reviewed-on: https://chromium-review.googlesource.com/255933
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Fix a crash when parsing a shader with incorrect constructor arguments.
BUG=angleproject:911
TEST=WebGL conformance tests
Change-Id: I3459612f36185db861a361fa916cc6b671795037
Reviewed-on: https://chromium-review.googlesource.com/255870
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Zhenyao Mo <zmo@chromium.org>
This paves the way for getting rid of the BuiltInFunctionEmulator
subclasses in favor of initializing the BuiltInFunctionEmulator
dynamically in Compiler subclasses. The eventual goal is getting rid of
GLSL output specific functionality in Compiler, which should be
language-agnostic.
BUG=angle:865
Change-Id: Ibb114b905785c7343b2726c97699268c982536a0
Reviewed-on: https://chromium-review.googlesource.com/255470
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Remove fall-through from non-empty labels in switch statements.
Tested with dEQP-GLES3.functional.shaders.*switch*. All pass except for tests
that require dFdx/dFdy, which fail for an unrelated reason.
Additional test coverage could still be useful for cases where a label is
terminated by a continue or return statement.
BUG=angle:921
Change-Id: I4741867789a9308d66d0adeabdaf83907106e2d2
Reviewed-on: https://chromium-review.googlesource.com/254550
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
dFdx, dFdy and fwidth are parts of the core language in ESSL3.
This fixes a regression from the patch "Set symbol extension at insertion".
BUG=angle:926
Change-Id: I6c0bbce3afad1f064ff115a16e23ea79bd584e49
Reviewed-on: https://chromium-review.googlesource.com/255450
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
DX9 emulates GL_R8_EXT using BGR8. When we made the switch to using
GL_R8_EXT for YUV decoding, we decreased performance on DX9 machines.
DX9 supports luminance, which we fall back to when R8 isn't available.
BUG=438736
Change-Id: Iaa8d0518d481927d66130ea1bf3a95a750c5a761
Reviewed-on: https://chromium-review.googlesource.com/255662
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
So we could generate shaders for Apple using core GL profile.
By switching to core profile, we still pass most WebGL conformance tests 1.0.2 on Linux, but not all, so apparently more work is needed.
However, I think it's OK to check this CL in because this output profile will be only used behind a chromium switch.
BUG=angleproject:933
TEST=webgl conformance tests
Change-Id: Iad70e1aebf82349d3fc5f4116c1d6bc4448193fd
Reviewed-on: https://chromium-review.googlesource.com/255282
Tested-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
One of the recent change that uses generic types to compact
the symbol table initialization has introduced a bug in 'min'
function implementation, just fixing it here.
TEST= dEQP tests:
dEQP-GLES3.functional.shaders.operator.common_functions.min.lowp_uvec*
Change-Id: I0e3d386c89bc07c3b656ec5029b8ce57f663cf46
Reviewed-on: https://chromium-review.googlesource.com/255369
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
No support for raw vertex data pointers yet.
BUG=angle:880
Change-Id: Ifa8099b0f49028a1465edecde495ba725ac79598
Reviewed-on: https://chromium-review.googlesource.com/252801
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
This patch outputs switch and case statements in HLSL, but ignores fall-through.
Switch statements that include fall-through cause the platform HLSL compiler to
generate errors.
BUG=angle:921
Change-Id: I10efbfb45076cf4fd79840698abafd8111e597d4
Reviewed-on: https://chromium-review.googlesource.com/251527
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
In case a condition with a wrong type is given to a case statement, it
generates an error but the compiler recovers. This caused ValidateSwitch
to assert. Fix this.
BUG=angle:921
Change-Id: I7949798cab923c2b168817471896470c6c611878
Reviewed-on: https://chromium-review.googlesource.com/254080
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Change-Id: Ia702abedc261d717c24152cb207ac80393ac864f
Reviewed-on: https://chromium-review.googlesource.com/242980
Reviewed-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Moved typedefs to the global namespace to avoid future name conflicts.
Change-Id: I70bd47d2516964cd040df48c0b2ca50bc32ba851
Reviewed-on: https://chromium-review.googlesource.com/254090
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>