Fix error report when active color buffer has no fs output
Also modify or remove some tests to sync up with the expected behavior
stated in spec.
Related to https://github.com/KhronosGroup/WebGL/pull/2780
If any draw buffer with an attachment does not have a defined fragment shader output,
draws generate INVALID_OPERATION.
Also remove Framebuffer masking for inactive outputs.
This workaround is no longer necessary as the WebGL spec has changed.
It also was never fully working and had bugs with certain orders of
calls.
Bug: angleproject:2872
Bug: chromium:927908
Bug: chromium:943538
Change-Id: I73715a6ab851ae3db7096f49ea0a9fdd6f576703
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1530018
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
diff --git a/src/tests/gl_tests/MultiviewDrawTest.cpp b/src/tests/gl_tests/MultiviewDrawTest.cpp
index 3a71ea9..27026a1 100644
--- a/src/tests/gl_tests/MultiviewDrawTest.cpp
+++ b/src/tests/gl_tests/MultiviewDrawTest.cpp
@@ -462,8 +462,9 @@
"#version 300 es\n"
"#extension GL_OVR_multiview2 : require\n"
"precision mediump float;\n"
+ "out vec4 color;\n"
"void main()\n"
- "{}\n";
+ "{color = vec4(1);}\n";
GLVertexArray vao;
GLBuffer vertexBuffer;
@@ -544,8 +545,9 @@
"#version 300 es\n"
"#extension GL_OVR_multiview2 : require\n"
"precision mediump float;\n"
+ "out vec4 color;\n"
"void main()\n"
- "{}\n";
+ "{color = vec4(1);}\n";
ANGLE_GL_PROGRAM(program, kVS, kFS);
glUseProgram(program);
@@ -684,6 +686,9 @@
GLTexture tex2DArray;
initOnePixelColorTexture2DMultiLayered(tex2DArray);
+ GLenum bufs[] = {GL_NONE};
+ glDrawBuffers(1, bufs);
+
// Check that drawArrays generates an error when there is an active transform feedback object
// and the number of views in the draw framebuffer is greater than 1.
{
@@ -777,6 +782,9 @@
GLTexture tex2DArr;
initOnePixelColorTexture2DMultiLayered(tex2DArr);
+ GLenum bufs[] = {GL_NONE};
+ glDrawBuffers(1, bufs);
+
// Check first case.
{
glUseProgram(dualViewProgram);