Translation of samplers to HLSL on D3D11 is changed as follows:
Instead of passing around HLSL sampler and HLSL texture references in
shaders, all references to ESSL samplers are converted to constant
indices within the shader body. Each ESSL sampler is identified by an
unique index. In the code generated to implement ESSL texture functions,
these indices are used to index arrays of HLSL samplers and HLSL
textures to get the sampler and texture to use.
HLSL textures and samplers are grouped into arrays by their types. Each
unique combination of a HLSL texture type + HLSL sampler type gets its
own array. To convert a unique sampler index to an index to one of these
arrays, a constant offset is applied. In the most common case of a 2D
texture and a regular (non-comparison) sampler, the index offset is
always zero and is omitted.
The end goal of this refactoring is to make adding extra metadata for
samplers easier. The unique sampler index can be used in follow-up
changes to index an array of metadata passed in uniforms, which can
contain such things as the base level of the texture.
This does not solve the issues with samplers in structs.
The interface from the point of view of libANGLE is still exactly the
same, the only thing that changes is how samplers are handled inside the
shader.
On feature level 9_3, the D3D compiler has a bug where it can report that
the maximum sampler index is exceeded when in fact it is not. This can
happen when an array of samplers is declared in the shader. Because of
this the new approach can't be used on D3D11 feature level 9_3, but it
will continue using the old approach instead.
BUG=angleproject:1261
TEST=angle_end2end_tests,
dEQP-GLES3.functional.shaders.texture_functions.* (no regressions)
dEQP-GLES3.functional.texture.units.* (no regressions)
Change-Id: I5fbb0c4280000202dc2795a628b56bd8194ef96f
Reviewed-on: https://chromium-review.googlesource.com/320571
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
These standard functions are much more powerful than the C random()
routines. Use them to improve the random utils, and use a class
to clean things up further.
This fixes a problem I was having using random_utils where I was
having trouble generating random 32 bit unsigned integers.
BUG=angleproject:1290
Change-Id: I5081764053d0667a4e323553b7dea531256aa778
Reviewed-on: https://chromium-review.googlesource.com/323440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Fixes a glitch on OSX where the root window would swap twice, causing a
glitch.
Change-Id: I5886105fb18ed8f45e69cd10b5d1cac49b82093f
Reviewed-on: https://chromium-review.googlesource.com/320291
Tryjob-Request: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
I'm not sure why yet, but when using angle in skia,
getIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs) sometimes fails,
and when that happens we attempt to allocate and array with the size of
maxVertexAttribs, which is uninitialized, which could be huge.
Prevent this by initializing the variable.
Also sweep through other similar calls and ensure that these use
initialized values (test code has not been updated)
BUG=skia:4380
Change-Id: If1f3cf72f2b2829ad3933637af8778d574a20f61
Reviewed-on: https://chromium-review.googlesource.com/307239
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Dian Xiang <dianx@google.com>
Tested-by: Hendrik Wagenaar <hendrikw@chromium.org>
If the GL_OES_texture_npot extension isn't active, then setting
GL_TEXTURE_WRAP_S/T to GL_REPEAT for a NPOT texture results in black
rendering. This is specified in Section 3.8.2 of the OpenGL ES 2.0
specification.
Setting GL_TEXTURE_WRAP_S/T to GL_CLAMP_TO_EDGE is valid even if the
NPOT extension isn't active.
Change-Id: Ibd553620995df32138bf8153d1036fd05d386d90
Reviewed-on: https://chromium-review.googlesource.com/306302
Tested-by: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Makes it an error to access gl_FragDepthEXT in #version 300 es shader.
TODO:
Lacks the feature to make "#extension GL_EXT_frag_depth : require" an
error for #version 300 es.
Reland of: https://chromium-review.googlesource.com/#/c/287570
BUG=angleproject:1102
TEST=angle_unittest
Change-Id: I064d918d65f37539cb1e14f12173ca5591a4ea3f
Reviewed-on: https://chromium-review.googlesource.com/301711
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Add GLES 3.1 and 3.2 headers.
Remove GLES 3.0 extension headers and entry point files.
Re-land fixes double define from different style defines in libGLESv2.gypi
and other projects.
Re-land fixes missing defines in angle_util project in gn.
Change-Id: I1952413cd4390e6f5450df809f8f5867bf6f49e2
Reviewed-on: https://chromium-review.googlesource.com/299771
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Issues with GN build.
This reverts commit 8284436798.
Change-Id: I99d186019135bbbe250e95c9567854108d31c556
Reviewed-on: https://chromium-review.googlesource.com/299870
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Add GLES 3.1 and 3.2 headers.
Remove GLES 3.0 extension headers and entry point files.
Re-land fixes double define from different style defines in libGLESv2.gypi and
other projects.
Change-Id: I6204dc767bd83b7aa7e4d6e2fa338b2ce7f304d8
Reviewed-on: https://chromium-review.googlesource.com/299401
Tested-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Linux compile failures to do gyp defines.
This reverts commit 8bbeabc179.
Change-Id: Icb31dd817414b3a9ab36e88cedab9c725af26b6b
Reviewed-on: https://chromium-review.googlesource.com/299173
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
Broke the Clang compile.
In file included from ../../third_party/angle/include/GLSLANG/ShaderLang.h:28:
../../third_party/angle/include/KHR/khrplatform.h:282:30: error: no newline at end of file [-Werror,-Wnewline-eof]
#endif /* __khrplatform_h_ */
Several other similar errors.
BUG=None
This reverts commit aac2035d85.
Change-Id: I407e7e65bb6a46d1d941c54cdf14a14758e22d96
Reviewed-on: https://chromium-review.googlesource.com/298834
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Splitting the file into two strings in shader_translator complicated
testing line/file numbering related functionality with it, since each
chunk passed to ShCompile has its own file number and line numbering.
These are exposed to the preprocessor in __FILE__ and __LINE__ predefined
macros.
Just supply the file to ShCompile in a single string. Also, since the
original motivation for splitting the string seems to have been to
exercise ShCompile with multiple strings, add a new unit test that
ensures that ShCompile handles multiple strings as expected.
BUG=angleproject:989
TEST=angle_unittests
Change-Id: I31d24925ec85ca3411e537df25a985f09737403e
Reviewed-on: https://chromium-review.googlesource.com/297251
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Mark EGL_KHR_create_context as supported in the DisplayGLs.
BUG=angleproject:1149
Change-Id: I20671535680eb2c3b9c08205cee243b3aa5c5821
Reviewed-on: https://chromium-review.googlesource.com/297080
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
This replaces the dual-use of sh::Attribute, which can be a bit
confusing to people expecting a literal output variable.
Currently not used in Chromium, so should be safe to land.
BUG=angleproject:1146
Change-Id: I436f2bc9dc4ddc3709369cb2baa344c6b13a21a2
Reviewed-on: https://chromium-review.googlesource.com/296683
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Exposes gl_SecondaryFragColor, glSecondaryFragData[] and
gl_MaxDualSourceDrawBuffers to GLES SL 1.0.
Relaxes rules for undefined output locations for GLES SL 3.0
and exposes gl_MaxDualSourceDrawBuffers.
If the output GL context is GL ES 2.0 or 3.0:
The emulation layer is expected to turn on EXT_blend_func_extended
if the output GL context supports it.
If the output GL context is GL:
The emulation layer is expected to turn on EXT_blend_func_extended
if the output GL context supports ARB_blend_func_extended or if GL
context is 3.2 or later.
If the source shader spec is GLES SL 2.0: The emulation layer is
expected to inspect the shader compilation output variables upon
linking. If output target is GL SL, the emulation layer should bind
color location 0, index 1 to "angle_SecondaryFragColor" if variable
"gl_SecondaryFragColorEXT" is used. Alternatively, emulation layer
should bind "angle_SecondaryFragData" to locations 0,1,2,3,..., all
color index 1, if "gl_SecondaryFragData" array is used.
(The caller can not bind the locations or specify output variables.)
If the source shader spec is GLES SL 3.0:
The emulation layer is expected to do location auto-resolve of the
the output variables that have undefined output locations that have
not been bound by the caller.
(The caller can not use gl_ built-ins, so nothing to do with those.)
BUG=angleproject:1085
TEST=angle_unittest
Change-Id: I5cafe205b0c29478b0dcd24aa89a7b0000f5d046
Reviewed-on: https://chromium-review.googlesource.com/287580
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Kimmo Kinnunen <kkinnunen@nvidia.com>
Makes it an error to access gl_FragDepthEXT in #version 300 es shader.
TODO:
Lacks the feature to make "#extension GL_EXT_frag_depth : require" an
error for #version 300 es.
BUG=angleproject:1102
TEST=angle_unittest
Change-Id: Ic313a0e1ed6369550d53885290f300fab1aaf304
Reviewed-on: https://chromium-review.googlesource.com/287570
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
EGLWindow does nothing with it per se, but some code was relying on it
to store it. Add width and height to ANGLETest and SampleApplication
instead. Also fix a typo in PerfTestParams, widowWidth -> windowWidth.
BUG=angleproject:1105
Change-Id: I26da607a2e6342864b508a50ee3cf8944608f868
Reviewed-on: https://chromium-review.googlesource.com/287379
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
User can pass -x=g130, ..., -x=g450 to get output in specific GLSL
version. Passing -x=g selects GLSL compatiblity profile.
BUG=angleproject:1085
Change-Id: Ia680e219eacb0e8a53b711ae277ecebf069dfdc7
Reviewed-on: https://chromium-review.googlesource.com/287220
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Kimmo Kinnunen <kkinnunen@nvidia.com>
Commit-Queue: Kimmo Kinnunen <kkinnunen@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This will help port OSWindow to other platforms.
BUG=angleproject:892
Change-Id: If9884d310d80421e2fc09cffd03bcf01327b1eee
Reviewed-on: https://chromium-review.googlesource.com/283900
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
This includes an implementation of OSX timer and path_utils.
BUG=angleproject:891
Change-Id: Id5440a8321bcfd4a61f3fe35b4a3fc0c651f564f
Reviewed-on: https://chromium-review.googlesource.com/278211
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
On Linux all windows are polled separately contrary to windows in which
the callback is used on all windows.
BUG=angleproject:892
Change-Id: Ib1538f12ab2fa1864d29c91b9c5bfc2204cd1fa7
Reviewed-on: https://chromium-review.googlesource.com/272945
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
These warnings are currently disabled because these files are not with
angle_code set to 1 in the gyp files to avoid gtest's code warnings.
We hope to either fix warnings in gtest or change our build system to
not use warnings for gtest.
BUG=angleproject:1003
Change-Id: I281781b77f92ef8c394dd53fbbd50d525e4da5c9
Reviewed-on: https://chromium-review.googlesource.com/271412
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
Two-thirds of them run and work well.
BUG=angleproject:892
Change-Id: I401a7ef4fd055eda7276bd34dcf0fc6ae0deff13
Reviewed-on: https://chromium-review.googlesource.com/270124
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
The essl_to_hlsl and essl_to_glsl projects were exactly the same so it
doesn't make sense to keep both.
BUG=angleproject:981
Change-Id: Ibf034a71e94ba5002f9c40ac87720bf0de74ae18
Reviewed-on: https://chromium-review.googlesource.com/266872
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
There was no real reason to keep them in an angle directory and it makes
the generated projects nicer.
BUG=angleproject:981
Change-Id: I844e44dc5c2df51f5292cff4bdffe5e951745aae
Reviewed-on: https://chromium-review.googlesource.com/266871
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>