Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/angle
Path: blob/main_old/src/tests/gl_tests/DrawBuffersTest.cpp
1693 views
1
//
2
// Copyright 2015 The ANGLE Project Authors. All rights reserved.
3
// Use of this source code is governed by a BSD-style license that can be
4
// found in the LICENSE file.
5
//
6
7
#include "test_utils/ANGLETest.h"
8
#include "test_utils/gl_raii.h"
9
10
using namespace angle;
11
12
class DrawBuffersTest : public ANGLETest
13
{
14
protected:
15
DrawBuffersTest()
16
{
17
setWindowWidth(128);
18
setWindowHeight(128);
19
setConfigRedBits(8);
20
setConfigGreenBits(8);
21
setConfigBlueBits(8);
22
setConfigAlphaBits(8);
23
setConfigDepthBits(24);
24
}
25
26
void testTearDown() override
27
{
28
glDeleteFramebuffers(1, &mFBO);
29
glDeleteFramebuffers(1, &mReadFramebuffer);
30
glDeleteTextures(4, mTextures);
31
}
32
33
// We must call a different DrawBuffers method depending on extension support. Use this
34
// method instead of calling on directly.
35
void setDrawBuffers(GLsizei n, const GLenum *drawBufs)
36
{
37
if (IsGLExtensionEnabled("GL_EXT_draw_buffers"))
38
{
39
glDrawBuffersEXT(n, drawBufs);
40
}
41
else
42
{
43
ASSERT_GE(getClientMajorVersion(), 3);
44
glDrawBuffers(n, drawBufs);
45
}
46
}
47
48
// Use this method to filter if we can support these tests.
49
bool setupTest()
50
{
51
if (getClientMajorVersion() < 3 && (!EnsureGLExtensionEnabled("GL_EXT_draw_buffers") ||
52
!EnsureGLExtensionEnabled("GL_ANGLE_framebuffer_blit")))
53
{
54
return false;
55
}
56
57
// This test seems to fail on an nVidia machine when the window is hidden
58
setWindowVisible(getOSWindow(), true);
59
60
glGenFramebuffers(1, &mFBO);
61
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mFBO);
62
63
glGenTextures(4, mTextures);
64
65
for (size_t texIndex = 0; texIndex < ArraySize(mTextures); texIndex++)
66
{
67
glBindTexture(GL_TEXTURE_2D, mTextures[texIndex]);
68
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, getWindowWidth(), getWindowHeight(), 0, GL_RGBA,
69
GL_UNSIGNED_BYTE, nullptr);
70
}
71
72
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &mMaxDrawBuffers);
73
74
glGenFramebuffers(1, &mReadFramebuffer);
75
glBindFramebuffer(GL_READ_FRAMEBUFFER, mReadFramebuffer);
76
77
return true;
78
}
79
80
void setupMRTProgramESSL3(bool bufferEnabled[8], GLuint *programOut)
81
{
82
std::stringstream strstr;
83
84
strstr << "#version 300 es\n"
85
"precision highp float;\n";
86
87
for (unsigned int index = 0; index < 8; index++)
88
{
89
if (bufferEnabled[index])
90
{
91
strstr << "layout(location = " << index
92
<< ") "
93
"out vec4 value"
94
<< index << ";\n";
95
}
96
}
97
98
strstr << "void main()\n"
99
"{\n";
100
101
for (unsigned int index = 0; index < 8; index++)
102
{
103
if (bufferEnabled[index])
104
{
105
unsigned int r = (index + 1) & 1;
106
unsigned int g = (index + 1) & 2;
107
unsigned int b = (index + 1) & 4;
108
109
strstr << " value" << index << " = vec4(" << r << ".0, " << g << ".0, " << b
110
<< ".0, 1.0);\n";
111
}
112
}
113
114
strstr << "}\n";
115
116
*programOut = CompileProgram(essl3_shaders::vs::Simple(), strstr.str().c_str());
117
if (*programOut == 0)
118
{
119
FAIL() << "shader compilation failed.";
120
}
121
}
122
123
void setupMRTProgramESSL1(bool bufferEnabled[8], GLuint *programOut)
124
{
125
std::stringstream strstr;
126
127
strstr << "#extension GL_EXT_draw_buffers : enable\n"
128
"precision highp float;\n"
129
"void main()\n"
130
"{\n";
131
132
for (unsigned int index = 0; index < 8; index++)
133
{
134
if (bufferEnabled[index])
135
{
136
unsigned int r = (index + 1) & 1;
137
unsigned int g = (index + 1) & 2;
138
unsigned int b = (index + 1) & 4;
139
140
strstr << " gl_FragData[" << index << "] = vec4(" << r << ".0, " << g << ".0, "
141
<< b << ".0, 1.0);\n";
142
}
143
}
144
145
strstr << "}\n";
146
147
*programOut = CompileProgram(essl1_shaders::vs::Simple(), strstr.str().c_str());
148
if (*programOut == 0)
149
{
150
FAIL() << "shader compilation failed.";
151
}
152
}
153
154
void setupMRTProgram(bool bufferEnabled[8], GLuint *programOut)
155
{
156
if (getClientMajorVersion() == 3)
157
{
158
setupMRTProgramESSL3(bufferEnabled, programOut);
159
}
160
else
161
{
162
ASSERT_EQ(getClientMajorVersion(), 2);
163
setupMRTProgramESSL1(bufferEnabled, programOut);
164
}
165
}
166
167
const char *positionAttrib()
168
{
169
if (getClientMajorVersion() == 3)
170
{
171
return essl3_shaders::PositionAttrib();
172
}
173
else
174
{
175
return essl1_shaders::PositionAttrib();
176
}
177
}
178
179
static GLColor getColorForIndex(unsigned int index)
180
{
181
GLubyte r = (((index + 1) & 1) > 0) ? 255 : 0;
182
GLubyte g = (((index + 1) & 2) > 0) ? 255 : 0;
183
GLubyte b = (((index + 1) & 4) > 0) ? 255 : 0;
184
return GLColor(r, g, b, 255u);
185
}
186
187
void verifyAttachment2DColor(unsigned int index,
188
GLuint textureName,
189
GLenum target,
190
GLint level,
191
GLColor color)
192
{
193
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target, textureName,
194
level);
195
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, color)
196
<< "index " << index;
197
}
198
199
void verifyAttachment2DUnwritten(unsigned int index, GLuint texture, GLenum target, GLint level)
200
{
201
verifyAttachment2DColor(index, texture, target, level, GLColor::transparentBlack);
202
}
203
204
void verifyAttachment2D(unsigned int index, GLuint texture, GLenum target, GLint level)
205
{
206
verifyAttachment2DColor(index, texture, target, level, getColorForIndex(index));
207
}
208
209
void verifyAttachment3DOES(unsigned int index, GLuint texture, GLint level, GLint layer)
210
{
211
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_OES_texture_3D"));
212
213
glFramebufferTexture3DOES(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_3D, texture,
214
level, layer);
215
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, getColorForIndex(index));
216
}
217
218
void verifyAttachmentLayer(unsigned int index, GLuint texture, GLint level, GLint layer)
219
{
220
glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture, level, layer);
221
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 2, getWindowHeight() / 2, getColorForIndex(index));
222
}
223
224
GLuint mFBO = 0;
225
GLuint mReadFramebuffer = 0;
226
GLuint mTextures[4] = {};
227
GLint mMaxDrawBuffers = 0;
228
};
229
230
class DrawBuffersWebGL2Test : public DrawBuffersTest
231
{
232
public:
233
DrawBuffersWebGL2Test()
234
{
235
setWebGLCompatibilityEnabled(true);
236
setRobustResourceInit(true);
237
}
238
};
239
240
// Verify that GL_MAX_DRAW_BUFFERS returns the expected values for D3D11
241
TEST_P(DrawBuffersTest, VerifyD3DLimits)
242
{
243
EGLPlatformParameters platform = GetParam().eglParameters;
244
245
ANGLE_SKIP_TEST_IF(platform.renderer != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
246
247
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &mMaxDrawBuffers);
248
249
if (platform.majorVersion == 9 && platform.minorVersion == 3)
250
{
251
// D3D11 Feature Level 9_3 supports 4 draw buffers
252
ASSERT_EQ(mMaxDrawBuffers, 4);
253
}
254
else
255
{
256
// D3D11 Feature Level 10_0+ supports 8 draw buffers
257
ASSERT_EQ(mMaxDrawBuffers, 8);
258
}
259
}
260
261
TEST_P(DrawBuffersTest, Gaps)
262
{
263
ANGLE_SKIP_TEST_IF(!setupTest());
264
265
// TODO(ynovikov): Investigate the failure (http://anglebug.com/1535)
266
ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsDesktopOpenGL());
267
268
// TODO(syoussefi): Qualcomm driver crashes in the presence of VK_ATTACHMENT_UNUSED.
269
// http://anglebug.com/3423
270
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAndroid());
271
272
// Fails on Intel Ubuntu 19.04 Mesa 19.0.2 Vulkan. http://anglebug.com/3616
273
ANGLE_SKIP_TEST_IF(IsLinux() && IsIntel() && IsVulkan());
274
275
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
276
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, mTextures[0], 0);
277
278
bool flags[8] = {false, true};
279
280
GLuint program;
281
setupMRTProgram(flags, &program);
282
283
const GLenum bufs[] = {GL_NONE, GL_COLOR_ATTACHMENT1};
284
setDrawBuffers(2, bufs);
285
drawQuad(program, positionAttrib(), 0.5);
286
287
verifyAttachment2D(1, mTextures[0], GL_TEXTURE_2D, 0);
288
289
glDeleteProgram(program);
290
}
291
292
// Test that blend works with gaps
293
TEST_P(DrawBuffersTest, BlendWithGaps)
294
{
295
ANGLE_SKIP_TEST_IF(!setupTest());
296
297
// Qualcomm driver crashes in the presence of VK_ATTACHMENT_UNUSED.
298
// http://anglebug.com/3423
299
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAndroid());
300
301
// Fails on Intel Ubuntu 19.04 Mesa 19.0.2 Vulkan. http://anglebug.com/3616
302
ANGLE_SKIP_TEST_IF(IsLinux() && IsIntel() && IsVulkan());
303
304
// http://anglebug.com/5154
305
ANGLE_SKIP_TEST_IF(IsOSX() && IsIntel() && IsDesktopOpenGL());
306
307
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
308
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, mTextures[0], 0);
309
310
ASSERT_GL_NO_ERROR();
311
312
bool flags[8] = {false, true};
313
314
GLuint program;
315
setupMRTProgram(flags, &program);
316
317
const GLenum bufs[] = {GL_NONE, GL_COLOR_ATTACHMENT1};
318
setDrawBuffers(2, bufs);
319
320
// Draws green into attachment 1
321
drawQuad(program, positionAttrib(), 0.5);
322
verifyAttachment2D(1, mTextures[0], GL_TEXTURE_2D, 0);
323
ASSERT_GL_NO_ERROR();
324
325
// Clear with red
326
glClearColor(1.0, 0.0, 0.0, 1.0);
327
glClear(GL_COLOR_BUFFER_BIT);
328
verifyAttachment2DColor(1, mTextures[0], GL_TEXTURE_2D, 0, GLColor(255u, 0, 0, 255u));
329
330
// Draw green into attachment 1 again but with blending, expecting yellow
331
glEnable(GL_BLEND);
332
glBlendFunc(GL_ONE, GL_ONE);
333
drawQuad(program, positionAttrib(), 0.5);
334
verifyAttachment2DColor(1, mTextures[0], GL_TEXTURE_2D, 0, GLColor(255u, 255u, 0, 255u));
335
ASSERT_GL_NO_ERROR();
336
337
glDeleteProgram(program);
338
}
339
340
// Test that clear works with gaps
341
TEST_P(DrawBuffersTest, ClearWithGaps)
342
{
343
// TODO(syoussefi): Qualcomm driver crashes in the presence of VK_ATTACHMENT_UNUSED.
344
// http://anglebug.com/3423
345
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAndroid());
346
347
ANGLE_SKIP_TEST_IF(!setupTest());
348
349
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &mMaxDrawBuffers);
350
ASSERT_GE(mMaxDrawBuffers, 4);
351
352
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
353
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0], 0);
354
355
glBindTexture(GL_TEXTURE_2D, mTextures[1]);
356
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_TEXTURE_2D, mTextures[1], 0);
357
358
const GLenum bufs[] = {GL_COLOR_ATTACHMENT0, GL_NONE, GL_NONE, GL_COLOR_ATTACHMENT3};
359
360
bool flags[8] = {true, false, false, true};
361
GLuint program;
362
setupMRTProgram(flags, &program);
363
364
setDrawBuffers(4, bufs);
365
366
glClearColor(1.0f, 1.0f, 0.0f, 1.0f);
367
glClear(GL_COLOR_BUFFER_BIT);
368
369
// A bogus draw to make sure clears are done with a render pass in the Vulkan backend.
370
glEnable(GL_BLEND);
371
glBlendFunc(GL_ZERO, GL_ONE);
372
drawQuad(program, positionAttrib(), 0.5);
373
EXPECT_GL_NO_ERROR();
374
375
verifyAttachment2DColor(0, mTextures[0], GL_TEXTURE_2D, 0, GLColor::yellow);
376
verifyAttachment2DColor(3, mTextures[1], GL_TEXTURE_2D, 0, GLColor::yellow);
377
378
EXPECT_GL_NO_ERROR();
379
}
380
381
TEST_P(DrawBuffersTest, FirstAndLast)
382
{
383
ANGLE_SKIP_TEST_IF(!setupTest());
384
385
// TODO(ynovikov): Investigate the failure (https://anglebug.com/1533)
386
ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsDesktopOpenGL());
387
388
// TODO(syoussefi): Qualcomm driver crashes in the presence of VK_ATTACHMENT_UNUSED.
389
// http://anglebug.com/3423
390
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAndroid());
391
392
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
393
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0], 0);
394
395
glBindTexture(GL_TEXTURE_2D, mTextures[1]);
396
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_TEXTURE_2D, mTextures[1], 0);
397
398
bool flags[8] = {true, false, false, true};
399
400
GLuint program;
401
setupMRTProgram(flags, &program);
402
403
const GLenum bufs[] = {GL_COLOR_ATTACHMENT0, GL_NONE, GL_NONE, GL_COLOR_ATTACHMENT3};
404
405
setDrawBuffers(4, bufs);
406
drawQuad(program, positionAttrib(), 0.5);
407
408
verifyAttachment2D(0, mTextures[0], GL_TEXTURE_2D, 0);
409
verifyAttachment2D(3, mTextures[1], GL_TEXTURE_2D, 0);
410
411
EXPECT_GL_NO_ERROR();
412
413
glDeleteProgram(program);
414
}
415
416
TEST_P(DrawBuffersTest, FirstHalfNULL)
417
{
418
ANGLE_SKIP_TEST_IF(!setupTest());
419
420
// TODO(ynovikov): Investigate the failure (https://anglebug.com/1533)
421
ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsDesktopOpenGL());
422
423
// TODO(syoussefi): Qualcomm driver crashes in the presence of VK_ATTACHMENT_UNUSED.
424
// http://anglebug.com/3423
425
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAndroid());
426
427
// Fails on Intel Ubuntu 19.04 Mesa 19.0.2 Vulkan. http://anglebug.com/3616
428
ANGLE_SKIP_TEST_IF(IsLinux() && IsIntel() && IsVulkan());
429
430
bool flags[8] = {false};
431
GLenum bufs[8] = {GL_NONE};
432
433
GLuint halfMaxDrawBuffers = static_cast<GLuint>(mMaxDrawBuffers) / 2;
434
435
for (GLuint texIndex = 0; texIndex < halfMaxDrawBuffers; texIndex++)
436
{
437
glBindTexture(GL_TEXTURE_2D, mTextures[texIndex]);
438
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + halfMaxDrawBuffers + texIndex,
439
GL_TEXTURE_2D, mTextures[texIndex], 0);
440
flags[texIndex + halfMaxDrawBuffers] = true;
441
bufs[texIndex + halfMaxDrawBuffers] = GL_COLOR_ATTACHMENT0 + halfMaxDrawBuffers + texIndex;
442
}
443
444
GLuint program;
445
setupMRTProgram(flags, &program);
446
447
setDrawBuffers(mMaxDrawBuffers, bufs);
448
drawQuad(program, positionAttrib(), 0.5);
449
450
for (GLuint texIndex = 0; texIndex < halfMaxDrawBuffers; texIndex++)
451
{
452
verifyAttachment2D(texIndex + halfMaxDrawBuffers, mTextures[texIndex], GL_TEXTURE_2D, 0);
453
}
454
455
EXPECT_GL_NO_ERROR();
456
457
glDeleteProgram(program);
458
}
459
460
// Test that non-zero draw buffers can be queried on the default framebuffer
461
TEST_P(DrawBuffersTest, DefaultFramebufferDrawBufferQuery)
462
{
463
ANGLE_SKIP_TEST_IF(!setupTest());
464
465
glBindFramebuffer(GL_FRAMEBUFFER, 0);
466
467
GLint drawbuffer = 0;
468
glGetIntegerv(GL_DRAW_BUFFER1, &drawbuffer);
469
EXPECT_GL_NO_ERROR();
470
471
EXPECT_EQ(GL_NONE, drawbuffer);
472
}
473
474
// Same as above but adds a state change from a program with different masks after a clear.
475
TEST_P(DrawBuffersWebGL2Test, TwoProgramsWithDifferentOutputsAndClear)
476
{
477
// TODO(http://anglebug.com/2872): Broken on the GL back-end.
478
ANGLE_SKIP_TEST_IF(IsOpenGL());
479
480
// TODO(ynovikov): Investigate the failure (https://anglebug.com/1533)
481
ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsDesktopOpenGL());
482
483
// TODO(syoussefi): Qualcomm driver crashes in the presence of VK_ATTACHMENT_UNUSED.
484
// http://anglebug.com/3423
485
ANGLE_SKIP_TEST_IF(IsVulkan() && IsAndroid());
486
487
ANGLE_SKIP_TEST_IF(!setupTest());
488
489
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &mMaxDrawBuffers);
490
ASSERT_GE(mMaxDrawBuffers, 4);
491
492
bool flags[8] = {false};
493
GLenum someBufs[4] = {GL_NONE};
494
GLenum allBufs[4] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2,
495
GL_COLOR_ATTACHMENT3};
496
497
constexpr GLuint kMaxBuffers = 4;
498
constexpr GLuint kHalfMaxBuffers = 2;
499
500
// Enable all draw buffers.
501
for (GLuint texIndex = 0; texIndex < kMaxBuffers; texIndex++)
502
{
503
glBindTexture(GL_TEXTURE_2D, mTextures[texIndex]);
504
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + texIndex, GL_TEXTURE_2D,
505
mTextures[texIndex], 0);
506
someBufs[texIndex] =
507
texIndex >= kHalfMaxBuffers ? GL_COLOR_ATTACHMENT0 + texIndex : GL_NONE;
508
509
// Mask out the first two buffers.
510
flags[texIndex] = texIndex >= kHalfMaxBuffers;
511
}
512
513
GLuint program;
514
setupMRTProgram(flags, &program);
515
516
// Now set up a second simple program that draws to FragColor. Should be broadcast.
517
ANGLE_GL_PROGRAM(simpleProgram, essl1_shaders::vs::Simple(), essl1_shaders::fs::Red());
518
519
// Draw with simple program.
520
drawQuad(simpleProgram, essl1_shaders::PositionAttrib(), 0.5f, 1.0f, true);
521
ASSERT_GL_NO_ERROR();
522
523
// Clear draw buffers.
524
setDrawBuffers(kMaxBuffers, someBufs);
525
glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
526
glClear(GL_COLOR_BUFFER_BIT);
527
528
ASSERT_GL_NO_ERROR();
529
530
// Verify first is drawn red, second is untouched, and last two are cleared green.
531
verifyAttachment2DColor(0, mTextures[0], GL_TEXTURE_2D, 0, GLColor::red);
532
verifyAttachment2DColor(1, mTextures[1], GL_TEXTURE_2D, 0, GLColor::transparentBlack);
533
verifyAttachment2DColor(2, mTextures[2], GL_TEXTURE_2D, 0, GLColor::green);
534
verifyAttachment2DColor(3, mTextures[3], GL_TEXTURE_2D, 0, GLColor::green);
535
536
// Draw with MRT program.
537
setDrawBuffers(kMaxBuffers, someBufs);
538
drawQuad(program, positionAttrib(), 0.5, 1.0f, true);
539
ASSERT_GL_NO_ERROR();
540
541
// Only the last two attachments should be updated.
542
verifyAttachment2DColor(0, mTextures[0], GL_TEXTURE_2D, 0, GLColor::red);
543
verifyAttachment2DColor(1, mTextures[1], GL_TEXTURE_2D, 0, GLColor::transparentBlack);
544
verifyAttachment2D(2, mTextures[2], GL_TEXTURE_2D, 0);
545
verifyAttachment2D(3, mTextures[3], GL_TEXTURE_2D, 0);
546
547
// Active draw buffers with no fragment output is not allowed.
548
setDrawBuffers(kMaxBuffers, allBufs);
549
drawQuad(program, positionAttrib(), 0.5, 1.0f, true);
550
ASSERT_GL_ERROR(GL_INVALID_OPERATION);
551
// Exception: when RASTERIZER_DISCARD is enabled.
552
glEnable(GL_RASTERIZER_DISCARD);
553
drawQuad(program, positionAttrib(), 0.5, 1.0f, true);
554
ASSERT_GL_NO_ERROR();
555
glDisable(GL_RASTERIZER_DISCARD);
556
// Exception: when all 4 channels of color mask are set to false.
557
glColorMask(false, false, false, false);
558
drawQuad(program, positionAttrib(), 0.5, 1.0f, true);
559
ASSERT_GL_NO_ERROR();
560
glColorMask(false, true, false, false);
561
drawQuad(program, positionAttrib(), 0.5, 1.0f, true);
562
ASSERT_GL_ERROR(GL_INVALID_OPERATION);
563
glColorMask(true, true, true, true);
564
drawQuad(program, positionAttrib(), 0.5, 1.0f, true);
565
ASSERT_GL_ERROR(GL_INVALID_OPERATION);
566
567
// Clear again. All attachments should be cleared.
568
glClear(GL_COLOR_BUFFER_BIT);
569
verifyAttachment2DColor(0, mTextures[0], GL_TEXTURE_2D, 0, GLColor::green);
570
verifyAttachment2DColor(1, mTextures[1], GL_TEXTURE_2D, 0, GLColor::green);
571
verifyAttachment2DColor(2, mTextures[2], GL_TEXTURE_2D, 0, GLColor::green);
572
verifyAttachment2DColor(3, mTextures[3], GL_TEXTURE_2D, 0, GLColor::green);
573
574
glDeleteProgram(program);
575
}
576
577
// Test clear with gaps in draw buffers, originally show up as
578
// webgl_conformance_vulkan_passthrough_tests conformance/extensions/webgl-draw-buffers.html
579
// failure. This is added for ease of debugging.
580
TEST_P(DrawBuffersWebGL2Test, Clear)
581
{
582
ANGLE_SKIP_TEST_IF(!setupTest());
583
584
constexpr GLint kMaxBuffers = 4;
585
586
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &mMaxDrawBuffers);
587
ASSERT_GE(mMaxDrawBuffers, kMaxBuffers);
588
589
GLenum drawBufs[kMaxBuffers] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1,
590
GL_COLOR_ATTACHMENT2, GL_COLOR_ATTACHMENT3};
591
592
// Enable all draw buffers.
593
for (GLuint texIndex = 0; texIndex < kMaxBuffers; texIndex++)
594
{
595
glBindTexture(GL_TEXTURE_2D, mTextures[texIndex]);
596
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + texIndex, GL_TEXTURE_2D,
597
mTextures[texIndex], 0);
598
}
599
600
// Clear with all draw buffers.
601
setDrawBuffers(kMaxBuffers, drawBufs);
602
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
603
glClear(GL_COLOR_BUFFER_BIT);
604
605
// Clear with first half none draw buffers.
606
drawBufs[0] = GL_NONE;
607
drawBufs[1] = GL_NONE;
608
setDrawBuffers(kMaxBuffers, drawBufs);
609
glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
610
glClear(GL_COLOR_BUFFER_BIT);
611
612
ASSERT_GL_NO_ERROR();
613
614
// Verify first is drawn red, second is untouched, and last two are cleared green.
615
verifyAttachment2DColor(0, mTextures[0], GL_TEXTURE_2D, 0, GLColor::red);
616
verifyAttachment2DColor(1, mTextures[1], GL_TEXTURE_2D, 0, GLColor::red);
617
verifyAttachment2DColor(2, mTextures[2], GL_TEXTURE_2D, 0, GLColor::green);
618
verifyAttachment2DColor(3, mTextures[3], GL_TEXTURE_2D, 0, GLColor::green);
619
}
620
621
TEST_P(DrawBuffersTest, UnwrittenOutputVariablesShouldNotCrash)
622
{
623
ANGLE_SKIP_TEST_IF(!setupTest());
624
625
// Bind two render targets but use a shader which writes only to the first one.
626
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
627
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0], 0);
628
629
glBindTexture(GL_TEXTURE_2D, mTextures[1]);
630
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, mTextures[1], 0);
631
632
bool flags[8] = {true, false};
633
634
GLuint program;
635
setupMRTProgram(flags, &program);
636
637
const GLenum bufs[] = {
638
GL_COLOR_ATTACHMENT0,
639
GL_COLOR_ATTACHMENT1,
640
GL_NONE,
641
GL_NONE,
642
};
643
644
setDrawBuffers(4, bufs);
645
646
// This call should not crash when we dynamically generate the HLSL code.
647
drawQuad(program, positionAttrib(), 0.5);
648
649
verifyAttachment2D(0, mTextures[0], GL_TEXTURE_2D, 0);
650
651
EXPECT_GL_NO_ERROR();
652
653
glDeleteProgram(program);
654
}
655
656
TEST_P(DrawBuffersTest, BroadcastGLFragColor)
657
{
658
// Broadcast is not supported on GLES 3.0.
659
ANGLE_SKIP_TEST_IF(getClientMajorVersion() >= 3);
660
ANGLE_SKIP_TEST_IF(!setupTest());
661
662
// Bind two render targets. gl_FragColor should be broadcast to both.
663
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
664
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0], 0);
665
666
glBindTexture(GL_TEXTURE_2D, mTextures[1]);
667
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, mTextures[1], 0);
668
669
const GLenum bufs[] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1};
670
671
constexpr char kFS[] =
672
"#extension GL_EXT_draw_buffers : enable\n"
673
"precision highp float;\n"
674
"uniform float u_zero;\n"
675
"void main()\n"
676
"{\n"
677
" gl_FragColor = vec4(1, 0, 0, 1);\n"
678
" if (u_zero < 1.0)\n"
679
" {\n"
680
" return;\n"
681
" }\n"
682
"}\n";
683
684
GLuint program = CompileProgram(essl1_shaders::vs::Simple(), kFS);
685
if (program == 0)
686
{
687
FAIL() << "shader compilation failed.";
688
}
689
690
setDrawBuffers(2, bufs);
691
drawQuad(program, essl1_shaders::PositionAttrib(), 0.5);
692
693
verifyAttachment2D(0, mTextures[0], GL_TEXTURE_2D, 0);
694
verifyAttachment2D(0, mTextures[1], GL_TEXTURE_2D, 0);
695
696
EXPECT_GL_NO_ERROR();
697
698
glDeleteProgram(program);
699
}
700
701
// Test that binding multiple layers of a 3D texture works correctly.
702
// This is the same as DrawBuffersTestES3.3DTextures but is used for GL_OES_texture_3D extension
703
// on GLES 2.0 instead.
704
TEST_P(DrawBuffersTest, 3DTexturesOES)
705
{
706
ANGLE_SKIP_TEST_IF(!setupTest());
707
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_OES_texture_3D"));
708
709
GLTexture texture;
710
glBindTexture(GL_TEXTURE_3D, texture.get());
711
glTexImage3DOES(GL_TEXTURE_3D, 0, GL_RGBA, getWindowWidth(), getWindowHeight(),
712
getWindowWidth(), 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
713
714
glFramebufferTexture3DOES(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_3D, texture.get(), 0,
715
0);
716
glFramebufferTexture3DOES(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_3D, texture.get(), 0,
717
1);
718
glFramebufferTexture3DOES(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_TEXTURE_3D, texture.get(), 0,
719
2);
720
glFramebufferTexture3DOES(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_TEXTURE_3D, texture.get(), 0,
721
3);
722
723
bool flags[8] = {true, true, true, true, false};
724
725
GLuint program;
726
setupMRTProgram(flags, &program);
727
728
const GLenum bufs[] = {
729
GL_COLOR_ATTACHMENT0,
730
GL_COLOR_ATTACHMENT1,
731
GL_COLOR_ATTACHMENT2,
732
GL_COLOR_ATTACHMENT3,
733
};
734
735
setDrawBuffers(4, bufs);
736
drawQuad(program, positionAttrib(), 0.5);
737
738
verifyAttachment3DOES(0, texture.get(), 0, 0);
739
verifyAttachment3DOES(1, texture.get(), 0, 1);
740
verifyAttachment3DOES(2, texture.get(), 0, 2);
741
verifyAttachment3DOES(3, texture.get(), 0, 3);
742
743
EXPECT_GL_NO_ERROR();
744
745
glDeleteProgram(program);
746
}
747
748
class DrawBuffersTestES3 : public DrawBuffersTest
749
{};
750
751
// Test that binding multiple layers of a 3D texture works correctly
752
TEST_P(DrawBuffersTestES3, 3DTextures)
753
{
754
ANGLE_SKIP_TEST_IF(!setupTest());
755
756
GLTexture texture;
757
glBindTexture(GL_TEXTURE_3D, texture.get());
758
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, getWindowWidth(), getWindowHeight(), getWindowWidth(),
759
0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
760
761
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture.get(), 0, 0);
762
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, texture.get(), 0, 1);
763
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, texture.get(), 0, 2);
764
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, texture.get(), 0, 3);
765
766
bool flags[8] = {true, true, true, true, false};
767
768
GLuint program;
769
setupMRTProgram(flags, &program);
770
771
const GLenum bufs[] = {
772
GL_COLOR_ATTACHMENT0,
773
GL_COLOR_ATTACHMENT1,
774
GL_COLOR_ATTACHMENT2,
775
GL_COLOR_ATTACHMENT3,
776
};
777
778
glDrawBuffers(4, bufs);
779
drawQuad(program, positionAttrib(), 0.5);
780
781
verifyAttachmentLayer(0, texture.get(), 0, 0);
782
verifyAttachmentLayer(1, texture.get(), 0, 1);
783
verifyAttachmentLayer(2, texture.get(), 0, 2);
784
verifyAttachmentLayer(3, texture.get(), 0, 3);
785
786
EXPECT_GL_NO_ERROR();
787
788
glDeleteProgram(program);
789
}
790
791
// Test that binding multiple layers of a 2D array texture works correctly
792
TEST_P(DrawBuffersTestES3, 2DArrayTextures)
793
{
794
ANGLE_SKIP_TEST_IF(!setupTest());
795
796
GLTexture texture;
797
glBindTexture(GL_TEXTURE_2D_ARRAY, texture.get());
798
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA, getWindowWidth(), getWindowHeight(),
799
getWindowWidth(), 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
800
801
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture.get(), 0, 0);
802
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, texture.get(), 0, 1);
803
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, texture.get(), 0, 2);
804
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, texture.get(), 0, 3);
805
806
bool flags[8] = {true, true, true, true, false};
807
808
GLuint program;
809
setupMRTProgram(flags, &program);
810
811
const GLenum bufs[] = {
812
GL_COLOR_ATTACHMENT0,
813
GL_COLOR_ATTACHMENT1,
814
GL_COLOR_ATTACHMENT2,
815
GL_COLOR_ATTACHMENT3,
816
};
817
818
glDrawBuffers(4, bufs);
819
drawQuad(program, positionAttrib(), 0.5);
820
821
verifyAttachmentLayer(0, texture.get(), 0, 0);
822
verifyAttachmentLayer(1, texture.get(), 0, 1);
823
verifyAttachmentLayer(2, texture.get(), 0, 2);
824
verifyAttachmentLayer(3, texture.get(), 0, 3);
825
826
EXPECT_GL_NO_ERROR();
827
828
glDeleteProgram(program);
829
}
830
831
// Vulkan backend is setting per buffer color mask to false for draw buffers that set to GL_NONE.
832
// These set of tests are to test draw buffer change followed by draw/clear/blit and followed by
833
// draw buffer change are behaving correctly.
834
class ColorMaskForDrawBuffersTest : public DrawBuffersTest
835
{
836
protected:
837
void setupColorMaskForDrawBuffersTest()
838
{
839
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
840
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0],
841
0);
842
glBindTexture(GL_TEXTURE_2D, mTextures[1]);
843
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, mTextures[1],
844
0);
845
glBindTexture(GL_TEXTURE_2D, mTextures[2]);
846
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_TEXTURE_2D, mTextures[2],
847
0);
848
849
constexpr char kFS_ESSL3[] =
850
"#version 300 es\n"
851
"precision highp float;\n"
852
"uniform mediump vec4 u_color0;\n"
853
"uniform mediump vec4 u_color1;\n"
854
"uniform mediump vec4 u_color2;\n"
855
"layout(location = 0) out vec4 out_color0;\n"
856
"layout(location = 1) out vec4 out_color1;\n"
857
"layout(location = 2) out vec4 out_color2;\n"
858
"void main()\n"
859
"{\n"
860
" out_color0 = u_color0;\n"
861
" out_color1 = u_color1;\n"
862
" out_color2 = u_color2;\n"
863
"}\n";
864
program = CompileProgram(essl3_shaders::vs::Simple(), kFS_ESSL3);
865
glUseProgram(program);
866
867
positionLocation = glGetAttribLocation(program, positionAttrib());
868
ASSERT_NE(-1, positionLocation);
869
color0UniformLocation = glGetUniformLocation(program, "u_color0");
870
ASSERT_NE(color0UniformLocation, -1);
871
color1UniformLocation = glGetUniformLocation(program, "u_color1");
872
ASSERT_NE(color1UniformLocation, -1);
873
color2UniformLocation = glGetUniformLocation(program, "u_color2");
874
ASSERT_NE(color2UniformLocation, -1);
875
876
glUniform4fv(color0UniformLocation, 1, GLColor::red.toNormalizedVector().data());
877
glUniform4fv(color1UniformLocation, 1, GLColor::green.toNormalizedVector().data());
878
glUniform4fv(color2UniformLocation, 1, GLColor::yellow.toNormalizedVector().data());
879
880
// First draw into both buffers so that buffer0 is red and buffer1 is green
881
resetDrawBuffers();
882
drawQuad(program, positionAttrib(), 0.5);
883
EXPECT_GL_NO_ERROR();
884
885
for (int i = 0; i < 4; i++)
886
{
887
drawBuffers[i] = GL_NONE;
888
}
889
}
890
891
void resetDrawBuffers()
892
{
893
drawBuffers[0] = GL_COLOR_ATTACHMENT0;
894
drawBuffers[1] = GL_COLOR_ATTACHMENT1;
895
drawBuffers[2] = GL_COLOR_ATTACHMENT2;
896
drawBuffers[3] = GL_NONE;
897
setDrawBuffers(4, drawBuffers);
898
}
899
900
GLenum drawBuffers[4];
901
GLuint program;
902
GLint positionLocation;
903
GLint color0UniformLocation;
904
GLint color1UniformLocation;
905
GLint color2UniformLocation;
906
};
907
908
// Test draw buffer state change followed draw call
909
TEST_P(ColorMaskForDrawBuffersTest, DrawQuad)
910
{
911
ANGLE_SKIP_TEST_IF(!setupTest());
912
setupColorMaskForDrawBuffersTest();
913
914
// Draw blue into attachment0. Buffer0 should be blue and buffer1 should remain green
915
drawBuffers[0] = GL_COLOR_ATTACHMENT0;
916
setDrawBuffers(4, drawBuffers);
917
glUniform4fv(color0UniformLocation, 1, GLColor::blue.toNormalizedVector().data());
918
glUniform4fv(color1UniformLocation, 1, GLColor::cyan.toNormalizedVector().data());
919
glViewport(0, 0, getWindowWidth() / 2, getWindowHeight() / 2);
920
drawQuad(program, positionAttrib(), 0.5);
921
922
resetDrawBuffers();
923
glUniform4fv(color0UniformLocation, 1, GLColor::magenta.toNormalizedVector().data());
924
glUniform4fv(color1UniformLocation, 1, GLColor::white.toNormalizedVector().data());
925
glViewport(getWindowWidth() / 2, 0, getWindowWidth() / 2, getWindowHeight() / 2);
926
drawQuad(program, positionAttrib(), 0.5);
927
EXPECT_GL_NO_ERROR();
928
929
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0],
930
0);
931
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() / 4, GLColor::blue);
932
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() * 3 / 4, getWindowHeight() / 4, GLColor::magenta);
933
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() * 3 / 4, GLColor::red);
934
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[1],
935
0);
936
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() / 4, GLColor::green);
937
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() * 3 / 4, getWindowHeight() / 4, GLColor::white);
938
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() * 3 / 4, GLColor::green);
939
EXPECT_GL_NO_ERROR();
940
}
941
942
// Test draw buffer state change followed clear
943
TEST_P(ColorMaskForDrawBuffersTest, Clear)
944
{
945
ANGLE_SKIP_TEST_IF(!setupTest());
946
setupColorMaskForDrawBuffersTest();
947
948
// Clear attachment1. Buffer0 should retain red and buffer1 should be blue
949
drawBuffers[1] = GL_COLOR_ATTACHMENT1;
950
setDrawBuffers(4, drawBuffers);
951
GLfloat *clearColor = GLColor::blue.toNormalizedVector().data();
952
glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
953
glClear(GL_COLOR_BUFFER_BIT);
954
verifyAttachment2DColor(0, mTextures[0], GL_TEXTURE_2D, 0, GLColor::red);
955
verifyAttachment2DColor(1, mTextures[1], GL_TEXTURE_2D, 0, GLColor::blue);
956
EXPECT_GL_NO_ERROR();
957
}
958
959
// Test draw buffer state change followed scissored clear
960
TEST_P(ColorMaskForDrawBuffersTest, ScissoredClear)
961
{
962
ANGLE_SKIP_TEST_IF(!setupTest());
963
setupColorMaskForDrawBuffersTest();
964
965
// Clear attachment1. Buffer0 should retain red and buffer1 should be blue
966
drawBuffers[1] = GL_COLOR_ATTACHMENT1;
967
setDrawBuffers(4, drawBuffers);
968
GLfloat *clearColor = GLColor::blue.toNormalizedVector().data();
969
glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
970
glScissor(0, 0, getWindowWidth() / 2, getWindowHeight() / 2);
971
glEnable(GL_SCISSOR_TEST);
972
glClear(GL_COLOR_BUFFER_BIT);
973
974
resetDrawBuffers();
975
clearColor = GLColor::magenta.toNormalizedVector().data();
976
glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
977
glScissor(getWindowWidth() / 2, 0, getWindowWidth() / 2, getWindowHeight() / 2);
978
glClear(GL_COLOR_BUFFER_BIT);
979
EXPECT_GL_NO_ERROR();
980
981
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0],
982
0);
983
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() / 4, GLColor::red);
984
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() * 3 / 4, getWindowHeight() / 4, GLColor::magenta);
985
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() * 3 / 4, GLColor::red);
986
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[1],
987
0);
988
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() / 4, GLColor::blue);
989
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() * 3 / 4, getWindowHeight() / 4, GLColor::magenta);
990
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() * 3 / 4, GLColor::green);
991
EXPECT_GL_NO_ERROR();
992
}
993
994
// Test draw buffer state change followed FBO blit
995
TEST_P(ColorMaskForDrawBuffersTest, Blit)
996
{
997
// http://anglebug.com/5284
998
ANGLE_SKIP_TEST_IF(IsMetal());
999
1000
ANGLE_SKIP_TEST_IF(!setupTest());
1001
setupColorMaskForDrawBuffersTest();
1002
1003
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[2],
1004
0);
1005
1006
// BLIT mTexture[2] to attachment0. Buffer0 should remain red and buffer1 should be yellow
1007
drawBuffers[0] = GL_COLOR_ATTACHMENT0;
1008
setDrawBuffers(4, drawBuffers);
1009
glBlitFramebuffer(0, 0, getWindowWidth(), getWindowHeight(), 0, 0, getWindowWidth(),
1010
getWindowHeight(), GL_COLOR_BUFFER_BIT, GL_NEAREST);
1011
verifyAttachment2DColor(0, mTextures[0], GL_TEXTURE_2D, 0, GLColor::yellow);
1012
verifyAttachment2DColor(1, mTextures[1], GL_TEXTURE_2D, 0, GLColor::green);
1013
EXPECT_GL_NO_ERROR();
1014
}
1015
1016
ANGLE_INSTANTIATE_TEST(DrawBuffersTest,
1017
ANGLE_ALL_TEST_PLATFORMS_ES2,
1018
ANGLE_ALL_TEST_PLATFORMS_ES3,
1019
WithNoTransformFeedback(ES2_VULKAN()));
1020
1021
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DrawBuffersWebGL2Test);
1022
ANGLE_INSTANTIATE_TEST_ES3(DrawBuffersWebGL2Test);
1023
1024
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DrawBuffersTestES3);
1025
ANGLE_INSTANTIATE_TEST_ES3(DrawBuffersTestES3);
1026
1027
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ColorMaskForDrawBuffersTest);
1028
ANGLE_INSTANTIATE_TEST_ES3(ColorMaskForDrawBuffersTest);
1029
1030