Commit 09eabed9 by Cody Northrop Committed by Commit Bot

Allow attribute linking for ES2

* Pipe webGL compatibility down to allow attribute aliasing. * Reject aliasing if shader level is too high, or webGL is in use. Bug: angleproject:3252 Change-Id: I3378fe707e3795a4b8a424989afccff42bc84344 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1556538Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent cafd7736
......@@ -1364,7 +1364,8 @@ angle::Result Program::link(const Context *context)
data.getCaps().maxVaryingVectors, packMode, &mState.mUniformBlocks, &mState.mUniforms,
&mState.mShaderStorageBlocks, &mState.mBufferVariables, &mState.mAtomicCounterBuffers));
if (!linkAttributes(context->getCaps(), mInfoLog))
if (!linkAttributes(context->getCaps(), mInfoLog,
context->getExtensions().webglCompatibility))
{
return angle::Result::Continue;
}
......@@ -3132,7 +3133,7 @@ bool Program::linkAtomicCounterBuffers()
}
// Assigns locations to all attributes from the bindings and program locations.
bool Program::linkAttributes(const Caps &caps, InfoLog &infoLog)
bool Program::linkAttributes(const Caps &caps, InfoLog &infoLog, bool webglCompatibility)
{
Shader *vertexShader = mState.getAttachedShader(ShaderType::Vertex);
......@@ -3196,10 +3197,10 @@ bool Program::linkAttributes(const Caps &caps, InfoLog &infoLog)
// In GLSL ES 3.00.6 and in WebGL, attribute aliasing produces a link error.
// In non-WebGL GLSL ES 1.00.17, attribute aliasing is allowed with some
// restrictions - see GLSL ES 1.00.17 section 2.10.4, but ANGLE currently has a bug.
// TODO: Remaining failures: http://anglebug.com/3252
if (linkedAttribute)
{
// TODO(jmadill): fix aliasing on ES2
// if (shaderVersion >= 300 && !webgl)
if (shaderVersion >= 300 || webglCompatibility)
{
infoLog << "Attribute '" << attribute.name << "' aliases attribute '"
<< linkedAttribute->name << "' at location " << regLocation;
......
......@@ -910,7 +910,7 @@ class Program final : angle::NonCopyable, public LabeledObject
void deleteSelf(const Context *context);
bool linkValidateShaders(InfoLog &infoLog);
bool linkAttributes(const Caps &caps, InfoLog &infoLog);
bool linkAttributes(const Caps &caps, InfoLog &infoLog, bool webglCompatibility);
bool linkInterfaceBlocks(const Caps &caps,
const Version &version,
bool webglCompatibility,
......
......@@ -74,9 +74,9 @@
1028 : dEQP-GLES2.functional.fbo.completeness.renderable.texture.stencil.srgb8 = FAIL
1028 : dEQP-GLES2.functional.fbo.completeness.renderable.texture.depth.srgb8 = FAIL
// Bind aliasing is not working currently
3252 : dEQP-GLES2.functional.attribute_location.bind_aliasing.cond* = FAIL
3252 : dEQP-GLES2.functional.attribute_location.bind_aliasing.max_cond* = FAIL
// Bind aliasing max_cond crashes on Windows, fails on other platforms.
// TODO(cnorthrop): Narrow skip list or fix the test
3252 : dEQP-GLES2.functional.attribute_location.bind_aliasing.max_cond* = SKIP
// Half float OES either has an implementation bug or a dEQP bug.
3283 : dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgba_half_float_oes = FAIL
......@@ -250,6 +250,7 @@
2630 GLES ANDROID : dEQP-GLES2.functional.shaders.struct.uniform.sampler_in_function_arg_* = FAIL
// Nexus 5x failures
3309 NEXUS5X GLES : dEQP-GLES2.functional.attribute_location.bind_aliasing.cond* = FAIL
3309 NEXUS5X GLES : dEQP-GLES2.functional.fbo.render.texsubimage.after_render_tex2d_rgb = FAIL
3309 NEXUS5X GLES : dEQP-GLES2.functional.polygon_offset.default_result_depth_clamp = FAIL
3309 NEXUS5X GLES : dEQP-GLES2.functional.shaders.return.output_write_in_func_always_vertex = FAIL
......
......@@ -110,9 +110,9 @@
// Failing everywhere
2322 : dEQP-GLES3.functional.shaders.metamorphic.* = FAIL
// Bind aliasing is not working currently
3252 : dEQP-GLES3.functional.attribute_location.bind_aliasing.cond* = FAIL
3252 : dEQP-GLES3.functional.attribute_location.bind_aliasing.max_cond* = FAIL
// Bind aliasing max_cond crashes on Windows, fails on other platforms.
// TODO(cnorthrop): Narrow skip list or fix the test
3252 : dEQP-GLES3.functional.attribute_location.bind_aliasing.max_cond* = SKIP
// Windows and Linux failures
1095 WIN : dEQP-GLES3.functional.texture.mipmap.2d.projected.* = FAIL
......@@ -503,6 +503,7 @@
2567 ANDROID GLES : dEQP-GLES3.functional.fbo.completeness.renderable.texture.stencil.rg_unsigned_byte = FAIL
// Nexus 5x failures
3308 NEXUS5X GLES : dEQP-GLES3.functional.attribute_location.bind_aliasing.cond* = FAIL
3308 NEXUS5X GLES : dEQP-GLES3.functional.polygon_offset.default_result_depth_clamp = FAIL
3308 NEXUS5X GLES : dEQP-GLES3.functional.polygon_offset.fixed24_result_depth_clamp = FAIL
3308 NEXUS5X GLES : dEQP-GLES3.functional.transform_feedback.random.interleaved.lines.3 = FAIL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment