• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2017 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 // TextureRectangleTest: Tests of GL_ANGLE_texture_rectangle
8 
9 #include "test_utils/ANGLETest.h"
10 #include "test_utils/gl_raii.h"
11 
12 using namespace angle;
13 
14 namespace
15 {
16 
17 class TextureRectangleTest : public ANGLETest
18 {
19   protected:
TextureRectangleTest()20     TextureRectangleTest()
21     {
22         setWindowWidth(64);
23         setWindowHeight(64);
24         setConfigRedBits(8);
25         setConfigGreenBits(8);
26         setConfigBlueBits(8);
27         setConfigAlphaBits(8);
28     }
29 
checkExtensionSupported() const30     bool checkExtensionSupported() const
31     {
32         if (!IsGLExtensionEnabled("GL_ANGLE_texture_rectangle"))
33         {
34             std::cout << "Test skipped because GL_ANGLE_texture_rectangle is not available."
35                       << std::endl;
36             return false;
37         }
38         return true;
39     }
40 };
41 
42 class TextureRectangleTestES3 : public TextureRectangleTest
43 {};
44 
45 class TextureRectangleTestES31 : public TextureRectangleTest
46 {};
47 
48 // Test using TexImage2D to define a rectangle texture
TEST_P(TextureRectangleTest,TexImage2D)49 TEST_P(TextureRectangleTest, TexImage2D)
50 {
51     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
52 
53     // http://anglebug.com/5651
54     ANGLE_SKIP_TEST_IF(IsLinux() && IsNVIDIA() && IsOpenGL());
55 
56     GLTexture tex;
57     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
58 
59     // Defining level 0 is allowed
60     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE,
61                  nullptr);
62     ASSERT_GL_NO_ERROR();
63 
64     // Defining level other than 0 is not allowed
65     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE,
66                  nullptr);
67     ASSERT_GL_ERROR(GL_INVALID_VALUE);
68 
69     GLint maxSize = 0;
70     glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE, &maxSize);
71 
72     // Defining a texture of the max size is allowed
73     {
74         ScopedIgnorePlatformMessages ignore;
75 
76         glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, maxSize, maxSize, 0, GL_RGBA,
77                      GL_UNSIGNED_BYTE, nullptr);
78         GLenum error = glGetError();
79         ASSERT_TRUE(error == GL_NO_ERROR || error == GL_OUT_OF_MEMORY);
80     }
81 
82     // Defining a texture of the max size is allowed
83     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, maxSize + 1, maxSize, 0, GL_RGBA,
84                  GL_UNSIGNED_BYTE, nullptr);
85     ASSERT_GL_ERROR(GL_INVALID_VALUE);
86     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, maxSize, maxSize + 1, 0, GL_RGBA,
87                  GL_UNSIGNED_BYTE, nullptr);
88     ASSERT_GL_ERROR(GL_INVALID_VALUE);
89 }
90 
91 // Test using CompressedTexImage2D cannot be used on a retangle texture
TEST_P(TextureRectangleTest,CompressedTexImage2DDisallowed)92 TEST_P(TextureRectangleTest, CompressedTexImage2DDisallowed)
93 {
94     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
95     ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_texture_compression_dxt1"));
96 
97     const char data[128] = {0};
98 
99     // Control case: 2D texture
100     {
101         GLTexture tex;
102         glBindTexture(GL_TEXTURE_2D, tex);
103         glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 16, 16, 0, 128,
104                                data);
105         ASSERT_GL_NO_ERROR();
106     }
107 
108     // Rectangle textures cannot be compressed
109     {
110         GLTexture tex;
111         glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
112         glCompressedTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 16,
113                                16, 0, 128, data);
114         ASSERT_GL_ERROR(GL_INVALID_ENUM);
115     }
116 }
117 
118 // Test using TexStorage2D to define a rectangle texture
TEST_P(TextureRectangleTest,TexStorage2D)119 TEST_P(TextureRectangleTest, TexStorage2D)
120 {
121     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
122     ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
123                        !IsGLExtensionEnabled("GL_EXT_texture_storage"));
124 
125     // http://anglebug.com/5651
126     ANGLE_SKIP_TEST_IF(IsLinux() && IsNVIDIA() && IsOpenGL());
127 
128     bool useES3       = getClientMajorVersion() >= 3;
129     auto TexStorage2D = [useES3](GLenum target, GLint levels, GLenum format, GLint width,
130                                  GLint height) {
131         if (useES3)
132         {
133             glTexStorage2D(target, levels, format, width, height);
134         }
135         else
136         {
137             glTexStorage2DEXT(target, levels, format, width, height);
138         }
139     };
140 
141     // Defining one level is allowed
142     {
143         GLTexture tex;
144         glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
145         TexStorage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_RGBA8, 16, 16);
146         ASSERT_GL_NO_ERROR();
147     }
148 
149     // Having more than one level is not allowed
150     {
151         GLTexture tex;
152         glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
153         // Use 5 levels because the EXT_texture_storage extension requires a mip chain all the way
154         // to a 1x1 mip.
155         TexStorage2D(GL_TEXTURE_RECTANGLE_ANGLE, 5, GL_RGBA8, 16, 16);
156         ASSERT_GL_ERROR(GL_INVALID_VALUE);
157     }
158 
159     GLint maxSize = 0;
160     glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE, &maxSize);
161 
162     // Defining a texture of the max size is allowed but still allow for OOM
163     {
164         ScopedIgnorePlatformMessages ignore;
165 
166         GLTexture tex;
167         glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
168         TexStorage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_RGBA8, maxSize, maxSize);
169         GLenum error = glGetError();
170         ASSERT_TRUE(error == GL_NO_ERROR || error == GL_OUT_OF_MEMORY);
171     }
172 
173     // Defining a texture of the max size is disallowed
174     {
175         GLTexture tex;
176         glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
177         TexStorage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_RGBA8, maxSize + 1, maxSize);
178         ASSERT_GL_ERROR(GL_INVALID_VALUE);
179         TexStorage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_RGBA8, maxSize, maxSize + 1);
180         ASSERT_GL_ERROR(GL_INVALID_VALUE);
181     }
182 
183     // Compressed formats are disallowed
184     if (IsGLExtensionEnabled("GL_EXT_texture_compression_dxt1"))
185     {
186         GLTexture tex;
187         glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
188         TexStorage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, 16, 16);
189         ASSERT_GL_ERROR(GL_INVALID_ENUM);
190     }
191 }
192 
193 // Test validation of disallowed texture parameters
TEST_P(TextureRectangleTest,TexParameterRestriction)194 TEST_P(TextureRectangleTest, TexParameterRestriction)
195 {
196     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
197 
198     GLTexture tex;
199     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
200 
201     // Only wrap mode CLAMP_TO_EDGE is supported
202     // Wrap S
203     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
204     ASSERT_GL_NO_ERROR();
205     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_S, GL_REPEAT);
206     ASSERT_GL_ERROR(GL_INVALID_ENUM);
207     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
208     ASSERT_GL_ERROR(GL_INVALID_ENUM);
209 
210     // Wrap T
211     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
212     ASSERT_GL_NO_ERROR();
213     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_T, GL_REPEAT);
214     ASSERT_GL_ERROR(GL_INVALID_ENUM);
215     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
216     ASSERT_GL_ERROR(GL_INVALID_ENUM);
217 
218     // Min filter has to be nearest or linear
219     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
220     ASSERT_GL_NO_ERROR();
221     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
222     ASSERT_GL_NO_ERROR();
223     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
224     ASSERT_GL_ERROR(GL_INVALID_ENUM);
225     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR);
226     ASSERT_GL_ERROR(GL_INVALID_ENUM);
227     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
228     ASSERT_GL_ERROR(GL_INVALID_ENUM);
229     glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
230     ASSERT_GL_ERROR(GL_INVALID_ENUM);
231 
232     // Base level has to be 0
233     if (getClientMajorVersion() >= 3)
234     {
235         glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_BASE_LEVEL, 0);
236         ASSERT_GL_NO_ERROR();
237         glTexParameteri(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_BASE_LEVEL, 1);
238         ASSERT_GL_ERROR(GL_INVALID_OPERATION);
239     }
240 }
241 
242 // Test validation of 'level' in GetTexParameter
TEST_P(TextureRectangleTestES31,GetTexLevelParameter)243 TEST_P(TextureRectangleTestES31, GetTexLevelParameter)
244 {
245     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
246 
247     GLTexture tex;
248     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
249     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE,
250                  nullptr);
251     ASSERT_GL_NO_ERROR();
252 
253     GLint param;
254     // Control case: level 0 is ok.
255     glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_TEXTURE_INTERNAL_FORMAT, &param);
256     ASSERT_GL_NO_ERROR();
257 
258     // Level 1 is not ok.
259     glGetTexLevelParameteriv(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_TEXTURE_INTERNAL_FORMAT, &param);
260     ASSERT_GL_ERROR(GL_INVALID_VALUE);
261 }
262 
263 // Test validation of "level" in FramebufferTexture2D
TEST_P(TextureRectangleTest,FramebufferTexture2DLevel)264 TEST_P(TextureRectangleTest, FramebufferTexture2DLevel)
265 {
266     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
267 
268     GLTexture tex;
269     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
270     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE,
271                  nullptr);
272     ASSERT_GL_NO_ERROR();
273 
274     GLFramebuffer fbo;
275     glBindFramebuffer(GL_FRAMEBUFFER, fbo);
276 
277     // Using level 0 of a rectangle texture is valid.
278     glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ANGLE, tex,
279                            0);
280     EXPECT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
281     ASSERT_GL_NO_ERROR();
282 
283     // Setting level != 0 is invalid
284     glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ANGLE, tex,
285                            1);
286     ASSERT_GL_ERROR(GL_INVALID_VALUE);
287 }
288 
289 // Test sampling from a rectangle texture using texture2DRect in ESSL1
TEST_P(TextureRectangleTest,SamplingFromRectangleESSL1)290 TEST_P(TextureRectangleTest, SamplingFromRectangleESSL1)
291 {
292     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
293 
294     GLTexture tex;
295     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
296     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
297                  &GLColor::green);
298 
299     constexpr char kFS[] =
300         "#extension GL_ARB_texture_rectangle : require\n"
301         "precision mediump float;\n"
302         "uniform sampler2DRect tex;\n"
303         "void main()\n"
304         "{\n"
305         "    gl_FragColor = texture2DRect(tex, vec2(0, 0));\n"
306         "}\n";
307 
308     ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Simple(), kFS);
309     glUseProgram(program);
310 
311     GLint location = glGetUniformLocation(program, "tex");
312     ASSERT_NE(-1, location);
313     glUniform1i(location, 0);
314 
315     glClearColor(0.0, 0.0, 0.0, 0.0);
316     glClear(GL_COLOR_BUFFER_BIT);
317     drawQuad(program, essl1_shaders::PositionAttrib(), 0.5f, 1.0f, false);
318     EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
319     ASSERT_GL_NO_ERROR();
320 }
321 
322 // Test sampling from a rectangle texture using the texture overload in ESSL3
TEST_P(TextureRectangleTestES3,SamplingFromRectangleESSL3)323 TEST_P(TextureRectangleTestES3, SamplingFromRectangleESSL3)
324 {
325     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
326 
327     GLTexture tex;
328     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
329     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
330                  &GLColor::green);
331 
332     constexpr char kFS[] =
333         "#version 300 es\n"
334         "#extension GL_ARB_texture_rectangle : require\n"
335         "precision mediump float;\n"
336         "uniform sampler2DRect tex;\n"
337         "out vec4 fragColor;\n"
338         "void main()\n"
339         "{\n"
340         "    fragColor = texture(tex, vec2(0, 0));\n"
341         "}\n";
342 
343     ANGLE_GL_PROGRAM(program, essl3_shaders::vs::Simple(), kFS);
344     glUseProgram(program);
345 
346     GLint location = glGetUniformLocation(program, "tex");
347     ASSERT_NE(-1, location);
348     glUniform1i(location, 0);
349 
350     glClearColor(0.0, 0.0, 0.0, 0.0);
351     glClear(GL_COLOR_BUFFER_BIT);
352     drawQuad(program, essl3_shaders::PositionAttrib(), 0.5f, 1.0f, false);
353     EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
354     ASSERT_GL_NO_ERROR();
355 }
356 
357 // Test attaching a rectangle texture and rendering to it.
TEST_P(TextureRectangleTest,RenderToRectangle)358 TEST_P(TextureRectangleTest, RenderToRectangle)
359 {
360     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
361 
362     GLTexture tex;
363     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
364     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
365                  &GLColor::black);
366 
367     GLFramebuffer fbo;
368     glBindFramebuffer(GL_FRAMEBUFFER, fbo);
369     glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ANGLE, tex,
370                            0);
371     EXPECT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
372     ASSERT_GL_NO_ERROR();
373 
374     // Clearing a texture is just as good as checking we can render to it, right?
375     glClearColor(0.0, 1.0, 0.0, 1.0);
376     glClear(GL_COLOR_BUFFER_BIT);
377     EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
378     ASSERT_GL_NO_ERROR();
379 }
380 
TEST_P(TextureRectangleTest,DefaultSamplerParameters)381 TEST_P(TextureRectangleTest, DefaultSamplerParameters)
382 {
383     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
384 
385     GLTexture tex;
386     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
387 
388     GLint minFilter = 0;
389     glGetTexParameteriv(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_MIN_FILTER, &minFilter);
390     EXPECT_EQ(GL_LINEAR, minFilter);
391 
392     GLint wrapS = 0;
393     glGetTexParameteriv(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_S, &wrapS);
394     EXPECT_EQ(GL_CLAMP_TO_EDGE, wrapS);
395 
396     GLint wrapT = 0;
397     glGetTexParameteriv(GL_TEXTURE_RECTANGLE_ANGLE, GL_TEXTURE_WRAP_T, &wrapT);
398     EXPECT_EQ(GL_CLAMP_TO_EDGE, wrapT);
399 }
400 
401 // Test glCopyTexImage with rectangle textures
TEST_P(TextureRectangleTestES3,CopyTexImage)402 TEST_P(TextureRectangleTestES3, CopyTexImage)
403 {
404     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
405 
406     GLTexture tex;
407     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
408 
409     glBindFramebuffer(GL_FRAMEBUFFER, 0);
410     glClearColor(0, 1, 0, 1);
411     glClear(GL_COLOR_BUFFER_BIT);
412     ASSERT_GL_NO_ERROR();
413 
414     // Error case: level != 0
415     glCopyTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, GL_RGBA8, 0, 0, 1, 1, 0);
416     ASSERT_GL_ERROR(GL_INVALID_VALUE);
417 
418     // level = 0 works and defines the texture.
419     glCopyTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA8, 0, 0, 1, 1, 0);
420     ASSERT_GL_NO_ERROR();
421 
422     GLFramebuffer fbo;
423     glBindFramebuffer(GL_FRAMEBUFFER, fbo);
424     glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ANGLE, tex,
425                            0);
426     EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
427     ASSERT_GL_NO_ERROR();
428 }
429 
430 // Test glCopyTexSubImage with rectangle textures
TEST_P(TextureRectangleTestES3,CopyTexSubImage)431 TEST_P(TextureRectangleTestES3, CopyTexSubImage)
432 {
433     ANGLE_SKIP_TEST_IF(!checkExtensionSupported());
434 
435     GLTexture tex;
436     glBindTexture(GL_TEXTURE_RECTANGLE_ANGLE, tex);
437     glTexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE,
438                  &GLColor::black);
439 
440     glBindFramebuffer(GL_FRAMEBUFFER, 0);
441     glClearColor(0, 1, 0, 1);
442     glClear(GL_COLOR_BUFFER_BIT);
443     ASSERT_GL_NO_ERROR();
444 
445     // Error case: level != 0
446     glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 1, 0, 0, 0, 0, 1, 1);
447     ASSERT_GL_ERROR(GL_INVALID_VALUE);
448 
449     // level = 0 works and defines the texture.
450     glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, 0, 0, 0, 0, 1, 1);
451     ASSERT_GL_NO_ERROR();
452 
453     GLFramebuffer fbo;
454     glBindFramebuffer(GL_FRAMEBUFFER, fbo);
455     glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ANGLE, tex,
456                            0);
457     EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
458     ASSERT_GL_NO_ERROR();
459 }
460 
461 ANGLE_INSTANTIATE_TEST_ES2(TextureRectangleTest);
462 
463 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TextureRectangleTestES3);
464 ANGLE_INSTANTIATE_TEST_ES3(TextureRectangleTestES3);
465 
466 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TextureRectangleTestES31);
467 ANGLE_INSTANTIATE_TEST_ES31(TextureRectangleTestES31);
468 }  // anonymous namespace
469