1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 2.0 Module
3 * -------------------------------------------------
5 * Copyright 2014 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief Mipmapping accuracy tests.
22 *//*--------------------------------------------------------------------*/
24 #include "es2aTextureMipmapTests.hpp"
25 #include "glsTextureTestUtil.hpp"
26 #include "gluTexture.hpp"
27 #include "gluStrUtil.hpp"
28 #include "gluTextureUtil.hpp"
29 #include "gluPixelTransfer.hpp"
30 #include "tcuTestLog.hpp"
31 #include "tcuTextureUtil.hpp"
32 #include "tcuTexVerifierUtil.hpp"
33 #include "tcuVector.hpp"
34 #include "tcuMatrix.hpp"
35 #include "tcuMatrixUtil.hpp"
36 #include "deStringUtil.hpp"
37 #include "deRandom.hpp"
39 #include "glwEnums.hpp"
40 #include "glwFunctions.hpp"
59 using namespace gls::TextureTestUtil;
60 using namespace glu::TextureTestUtil;
64 COORDTYPE_BASIC, //!< texCoord = translateScale(position).
65 COORDTYPE_BASIC_BIAS, //!< Like basic, but with bias values.
66 COORDTYPE_AFFINE, //!< texCoord = translateScaleRotateShear(position).
67 COORDTYPE_PROJECTED, //!< Projected coordinates, w != 1
72 // Texture2DMipmapCase
74 class Texture2DMipmapCase : public tcu::TestCase
78 Texture2DMipmapCase (tcu::TestContext& testCtx,
79 glu::RenderContext& renderCtx,
80 const glu::ContextInfo& renderCtxInfo,
91 ~Texture2DMipmapCase (void);
95 IterateResult iterate (void);
98 Texture2DMipmapCase (const Texture2DMipmapCase& other);
99 Texture2DMipmapCase& operator= (const Texture2DMipmapCase& other);
101 glu::RenderContext& m_renderCtx;
102 const glu::ContextInfo& m_renderCtxInfo;
104 CoordType m_coordType;
105 deUint32 m_minFilter;
113 glu::Texture2D* m_texture;
114 TextureRenderer m_renderer;
117 Texture2DMipmapCase::Texture2DMipmapCase (tcu::TestContext& testCtx,
118 glu::RenderContext& renderCtx,
119 const glu::ContextInfo& renderCtxInfo,
130 : TestCase (testCtx, tcu::NODETYPE_ACCURACY, name, desc)
131 , m_renderCtx (renderCtx)
132 , m_renderCtxInfo (renderCtxInfo)
133 , m_coordType (coordType)
134 , m_minFilter (minFilter)
138 , m_dataType (dataType)
141 , m_texture (DE_NULL)
142 , m_renderer (renderCtx, testCtx.getLog(), glu::GLSL_VERSION_100_ES,
143 renderCtxInfo.isFragmentHighPrecisionSupported() ? glu::PRECISION_HIGHP // Use highp if available.
144 : glu::PRECISION_MEDIUMP)
148 Texture2DMipmapCase::~Texture2DMipmapCase (void)
153 void Texture2DMipmapCase::init (void)
155 if (!m_renderCtxInfo.isFragmentHighPrecisionSupported())
156 m_testCtx.getLog() << TestLog::Message << "Warning: High precision not supported in fragment shaders." << TestLog::EndMessage;
158 m_texture = new Texture2D(m_renderCtx, m_format, m_dataType, m_width, m_height);
160 int numLevels = deLog2Floor32(de::max(m_width, m_height))+1;
162 // Fill texture with colored grid.
163 for (int levelNdx = 0; levelNdx < numLevels; levelNdx++)
165 deUint32 step = 0xff / (numLevels-1);
166 deUint32 inc = deClamp32(step*levelNdx, 0x00, 0xff);
167 deUint32 dec = 0xff - inc;
168 deUint32 rgb = (inc << 16) | (dec << 8) | 0xff;
169 deUint32 color = 0xff000000 | rgb;
171 m_texture->getRefTexture().allocLevel(levelNdx);
172 tcu::clear(m_texture->getRefTexture().getLevel(levelNdx), tcu::RGBA(color).toVec());
176 void Texture2DMipmapCase::deinit (void)
184 static void getBasicTexCoord2D (std::vector<float>& dst, int cellNdx)
192 { Vec2(-0.1f, 0.1f), Vec2( 0.8f, 1.0f) },
193 { Vec2(-0.3f, -0.6f), Vec2( 0.7f, 0.4f) },
194 { Vec2(-0.3f, 0.6f), Vec2( 0.7f, -0.9f) },
195 { Vec2(-0.8f, 0.6f), Vec2( 0.7f, -0.9f) },
197 { Vec2(-0.5f, -0.5f), Vec2( 1.5f, 1.5f) },
198 { Vec2( 1.0f, -1.0f), Vec2(-1.3f, 1.0f) },
199 { Vec2( 1.2f, -1.0f), Vec2(-1.3f, 1.6f) },
200 { Vec2( 2.2f, -1.1f), Vec2(-1.3f, 0.8f) },
202 { Vec2(-1.5f, 1.6f), Vec2( 1.7f, -1.4f) },
203 { Vec2( 2.0f, 1.6f), Vec2( 2.3f, -1.4f) },
204 { Vec2( 1.3f, -2.6f), Vec2(-2.7f, 2.9f) },
205 { Vec2(-0.8f, -6.6f), Vec2( 6.0f, -0.9f) },
207 { Vec2( -8.0f, 9.0f), Vec2( 8.3f, -7.0f) },
208 { Vec2(-16.0f, 10.0f), Vec2( 18.3f, 24.0f) },
209 { Vec2( 30.2f, 55.0f), Vec2(-24.3f, -1.6f) },
210 { Vec2(-33.2f, 64.1f), Vec2( 32.1f, -64.1f) },
213 DE_ASSERT(de::inBounds(cellNdx, 0, DE_LENGTH_OF_ARRAY(s_basicCoords)));
215 const Vec2& bottomLeft = s_basicCoords[cellNdx].bottomLeft;
216 const Vec2& topRight = s_basicCoords[cellNdx].topRight;
218 computeQuadTexCoord2D(dst, bottomLeft, topRight);
221 static void getAffineTexCoord2D (std::vector<float>& dst, int cellNdx)
223 // Use basic coords as base.
224 getBasicTexCoord2D(dst, cellNdx);
226 // Rotate based on cell index.
227 float angle = 2.0f*DE_PI * ((float)cellNdx / 16.0f);
228 tcu::Mat2 rotMatrix = tcu::rotationMatrix(angle);
230 // Second and third row are sheared.
231 float shearX = de::inRange(cellNdx, 4, 11) ? (float)(15-cellNdx) / 16.0f : 0.0f;
232 tcu::Mat2 shearMatrix = tcu::shearMatrix(tcu::Vec2(shearX, 0.0f));
234 tcu::Mat2 transform = rotMatrix * shearMatrix;
235 Vec2 p0 = transform * Vec2(dst[0], dst[1]);
236 Vec2 p1 = transform * Vec2(dst[2], dst[3]);
237 Vec2 p2 = transform * Vec2(dst[4], dst[5]);
238 Vec2 p3 = transform * Vec2(dst[6], dst[7]);
240 dst[0] = p0.x(); dst[1] = p0.y();
241 dst[2] = p1.x(); dst[3] = p1.y();
242 dst[4] = p2.x(); dst[5] = p2.y();
243 dst[6] = p3.x(); dst[7] = p3.y();
246 Texture2DMipmapCase::IterateResult Texture2DMipmapCase::iterate (void)
249 const deUint32 magFilter = GL_NEAREST;
251 const glw::Functions& gl = m_renderCtx.getFunctions();
252 TestLog& log = m_testCtx.getLog();
254 const tcu::Texture2D& refTexture = m_texture->getRefTexture();
255 const tcu::TextureFormat& texFmt = refTexture.getFormat();
256 tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(texFmt);
258 int texWidth = refTexture.getWidth();
259 int texHeight = refTexture.getHeight();
260 int defViewportWidth = texWidth*4;
261 int defViewportHeight = texHeight*4;
263 RandomViewport viewport (m_renderCtx.getRenderTarget(), defViewportWidth, defViewportHeight, deStringHash(getName()));
264 ReferenceParams sampleParams (TEXTURETYPE_2D);
265 vector<float> texCoord;
266 bool isProjected = m_coordType == COORDTYPE_PROJECTED;
267 bool useLodBias = m_coordType == COORDTYPE_BASIC_BIAS;
269 tcu::Surface renderedFrame (viewport.width, viewport.height);
271 // Accuracy cases test against ideal lod computation.
272 tcu::Surface idealFrame (viewport.width, viewport.height);
274 // Viewport is divided into 4x4 grid.
277 int cellWidth = viewport.width / gridWidth;
278 int cellHeight = viewport.height / gridHeight;
280 // Accuracy measurements are off unless we get the expected viewport size.
281 if (viewport.width < defViewportWidth || viewport.height < defViewportHeight)
282 throw tcu::NotSupportedError("Too small viewport", "", __FILE__, __LINE__);
284 // Sampling parameters.
285 sampleParams.sampler = glu::mapGLSampler(m_wrapS, m_wrapT, m_minFilter, magFilter);
286 sampleParams.samplerType = glu::TextureTestUtil::getSamplerType(m_texture->getRefTexture().getFormat());
287 sampleParams.colorBias = fmtInfo.lookupBias;
288 sampleParams.colorScale = fmtInfo.lookupScale;
289 sampleParams.flags = (isProjected ? ReferenceParams::PROJECTED : 0) | (useLodBias ? ReferenceParams::USE_BIAS : 0);
291 // Upload texture data.
295 gl.activeTexture(GL_TEXTURE0);
297 // Bind gradient texture and setup sampler parameters.
298 gl.bindTexture(GL_TEXTURE_2D, m_texture->getGLTexture());
299 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, m_wrapS);
300 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, m_wrapT);
301 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, m_minFilter);
302 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magFilter);
304 GLU_EXPECT_NO_ERROR(gl.getError(), "After texture setup");
307 static const float s_bias[] = { 1.0f, -2.0f, 0.8f, -0.5f, 1.5f, 0.9f, 2.0f, 4.0f };
309 // Projection values.
310 static const Vec4 s_projections[] =
312 Vec4(1.2f, 1.0f, 0.7f, 1.0f),
313 Vec4(1.3f, 0.8f, 0.6f, 2.0f),
314 Vec4(0.8f, 1.0f, 1.7f, 0.6f),
315 Vec4(1.2f, 1.0f, 1.7f, 1.5f)
319 for (int gridY = 0; gridY < gridHeight; gridY++)
321 for (int gridX = 0; gridX < gridWidth; gridX++)
323 int curX = cellWidth*gridX;
324 int curY = cellHeight*gridY;
325 int curW = gridX+1 == gridWidth ? (viewport.width-curX) : cellWidth;
326 int curH = gridY+1 == gridHeight ? (viewport.height-curY) : cellHeight;
327 int cellNdx = gridY*gridWidth + gridX;
332 case COORDTYPE_BASIC_BIAS: // Fall-through.
333 case COORDTYPE_PROJECTED:
334 case COORDTYPE_BASIC: getBasicTexCoord2D (texCoord, cellNdx); break;
335 case COORDTYPE_AFFINE: getAffineTexCoord2D (texCoord, cellNdx); break;
336 default: DE_ASSERT(DE_FALSE);
340 sampleParams.w = s_projections[cellNdx % DE_LENGTH_OF_ARRAY(s_projections)];
343 sampleParams.bias = s_bias[cellNdx % DE_LENGTH_OF_ARRAY(s_bias)];
346 gl.viewport(viewport.x+curX, viewport.y+curY, curW, curH);
347 m_renderer.renderQuad(0, &texCoord[0], sampleParams);
349 // Render reference(s).
351 tcu::SurfaceAccess idealDst(idealFrame, m_renderCtx.getRenderTarget().getPixelFormat(), curX, curY, curW, curH);
352 sampleParams.lodMode = LODMODE_EXACT;
353 sampleTexture(idealDst, m_texture->getRefTexture(), &texCoord[0], sampleParams);
359 glu::readPixels(m_renderCtx, viewport.x, viewport.y, renderedFrame.getAccess());
363 const int bestScoreDiff = (texWidth/16)*(texHeight/16);
364 const int worstScoreDiff = texWidth*texHeight;
366 int score = measureAccuracy(log, idealFrame, renderedFrame, bestScoreDiff, worstScoreDiff);
367 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, de::toString(score).c_str());
373 // TextureCubeMipmapCase
375 class TextureCubeMipmapCase : public tcu::TestCase
379 TextureCubeMipmapCase (tcu::TestContext& testCtx,
380 glu::RenderContext& renderCtx,
381 const glu::ContextInfo& renderCtxInfo,
391 ~TextureCubeMipmapCase (void);
395 IterateResult iterate (void);
398 TextureCubeMipmapCase (const TextureCubeMipmapCase& other);
399 TextureCubeMipmapCase& operator= (const TextureCubeMipmapCase& other);
401 glu::RenderContext& m_renderCtx;
402 const glu::ContextInfo& m_renderCtxInfo;
404 CoordType m_coordType;
405 deUint32 m_minFilter;
412 glu::TextureCube* m_texture;
413 TextureRenderer m_renderer;
416 TextureCubeMipmapCase::TextureCubeMipmapCase (tcu::TestContext& testCtx,
417 glu::RenderContext& renderCtx,
418 const glu::ContextInfo& renderCtxInfo,
428 : TestCase (testCtx, tcu::NODETYPE_ACCURACY, name, desc)
429 , m_renderCtx (renderCtx)
430 , m_renderCtxInfo (renderCtxInfo)
431 , m_coordType (coordType)
432 , m_minFilter (minFilter)
436 , m_dataType (dataType)
438 , m_texture (DE_NULL)
439 , m_renderer (renderCtx, testCtx.getLog(), glu::GLSL_VERSION_100_ES,
440 renderCtxInfo.isFragmentHighPrecisionSupported() ? glu::PRECISION_HIGHP // Use highp if available.
441 : glu::PRECISION_MEDIUMP)
445 TextureCubeMipmapCase::~TextureCubeMipmapCase (void)
450 void TextureCubeMipmapCase::init (void)
452 if (!m_renderCtxInfo.isFragmentHighPrecisionSupported())
453 m_testCtx.getLog() << TestLog::Message << "Warning: High precision not supported in fragment shaders." << TestLog::EndMessage;
455 m_texture = new TextureCube(m_renderCtx, m_format, m_dataType, m_size);
457 int numLevels = deLog2Floor32(m_size)+1;
459 // Fill texture with colored grid.
460 for (int faceNdx = 0; faceNdx < tcu::CUBEFACE_LAST; faceNdx++)
462 for (int levelNdx = 0; levelNdx < numLevels; levelNdx++)
464 deUint32 step = 0xff / (numLevels-1);
465 deUint32 inc = deClamp32(step*levelNdx, 0x00, 0xff);
466 deUint32 dec = 0xff - inc;
471 case 0: rgb = (inc << 16) | (dec << 8) | 255; break;
472 case 1: rgb = (255 << 16) | (inc << 8) | dec; break;
473 case 2: rgb = (dec << 16) | (255 << 8) | inc; break;
474 case 3: rgb = (dec << 16) | (inc << 8) | 255; break;
475 case 4: rgb = (255 << 16) | (dec << 8) | inc; break;
476 case 5: rgb = (inc << 16) | (255 << 8) | dec; break;
479 deUint32 color = 0xff000000 | rgb;
481 m_texture->getRefTexture().allocLevel((tcu::CubeFace)faceNdx, levelNdx);
482 tcu::clear(m_texture->getRefTexture().getLevelFace(levelNdx, (tcu::CubeFace)faceNdx), tcu::RGBA(color).toVec());
487 void TextureCubeMipmapCase::deinit (void)
495 static void randomPartition (vector<IVec4>& dst, de::Random& rnd, int x, int y, int width, int height)
497 const int minWidth = 8;
498 const int minHeight = 8;
500 bool partition = rnd.getFloat() > 0.4f;
501 bool partitionX = partition && width > minWidth && rnd.getBool();
502 bool partitionY = partition && height > minHeight && !partitionX;
506 int split = width/2 + rnd.getInt(-width/4, +width/4);
507 randomPartition(dst, rnd, x, y, split, height);
508 randomPartition(dst, rnd, x+split, y, width-split, height);
512 int split = height/2 + rnd.getInt(-height/4, +height/4);
513 randomPartition(dst, rnd, x, y, width, split);
514 randomPartition(dst, rnd, x, y+split, width, height-split);
517 dst.push_back(IVec4(x, y, width, height));
520 static void computeGridLayout (vector<IVec4>& dst, int width, int height)
523 randomPartition(dst, rnd, 0, 0, width, height);
526 TextureCubeMipmapCase::IterateResult TextureCubeMipmapCase::iterate (void)
529 const deUint32 magFilter = GL_NEAREST;
531 int texWidth = m_texture->getRefTexture().getSize();
532 int texHeight = m_texture->getRefTexture().getSize();
534 int defViewportWidth = texWidth*2;
535 int defViewportHeight = texHeight*2;
537 const glw::Functions& gl = m_renderCtx.getFunctions();
538 TestLog& log = m_testCtx.getLog();
539 RandomViewport viewport (m_renderCtx.getRenderTarget(), defViewportWidth, defViewportHeight, deStringHash(getName()));
540 tcu::Sampler sampler = mapGLSampler(m_wrapS, m_wrapT, m_minFilter, magFilter);
542 vector<float> texCoord;
544 bool isProjected = m_coordType == COORDTYPE_PROJECTED;
545 bool useLodBias = m_coordType == COORDTYPE_BASIC_BIAS;
547 tcu::Surface renderedFrame (viewport.width, viewport.height);
549 // Accuracy cases test against ideal lod computation.
550 tcu::Surface idealFrame (viewport.width, viewport.height);
552 // Accuracy measurements are off unless we get the expected viewport size.
553 if (viewport.width < defViewportWidth || viewport.height < defViewportHeight)
554 throw tcu::NotSupportedError("Too small viewport", "", __FILE__, __LINE__);
556 // Upload texture data.
560 gl.activeTexture(GL_TEXTURE0);
562 // Bind gradient texture and setup sampler parameters.
563 gl.bindTexture(GL_TEXTURE_CUBE_MAP, m_texture->getGLTexture());
564 gl.texParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, m_wrapS);
565 gl.texParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, m_wrapT);
566 gl.texParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, m_minFilter);
567 gl.texParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, magFilter);
569 GLU_EXPECT_NO_ERROR(gl.getError(), "After texture setup");
572 vector<IVec4> gridLayout;
573 computeGridLayout(gridLayout, viewport.width, viewport.height);
576 static const float s_bias[] = { 1.0f, -2.0f, 0.8f, -0.5f, 1.5f, 0.9f, 2.0f, 4.0f };
578 // Projection values \note Less agressive than in 2D case due to smaller quads.
579 static const Vec4 s_projections[] =
581 Vec4(1.2f, 1.0f, 0.7f, 1.0f),
582 Vec4(1.3f, 0.8f, 0.6f, 1.1f),
583 Vec4(0.8f, 1.0f, 1.2f, 0.8f),
584 Vec4(1.2f, 1.0f, 1.3f, 0.9f)
587 for (int cellNdx = 0; cellNdx < (int)gridLayout.size(); cellNdx++)
589 int curX = gridLayout[cellNdx].x();
590 int curY = gridLayout[cellNdx].y();
591 int curW = gridLayout[cellNdx].z();
592 int curH = gridLayout[cellNdx].w();
593 tcu::CubeFace cubeFace = (tcu::CubeFace)(cellNdx % tcu::CUBEFACE_LAST);
594 ReferenceParams params (TEXTURETYPE_CUBE);
596 params.sampler = sampler;
598 DE_ASSERT(m_coordType != COORDTYPE_AFFINE); // Not supported.
599 computeQuadTexCoordCube(texCoord, cubeFace);
603 params.flags |= ReferenceParams::PROJECTED;
604 params.w = s_projections[cellNdx % DE_LENGTH_OF_ARRAY(s_projections)];
609 params.flags |= ReferenceParams::USE_BIAS;
610 params.bias = s_bias[cellNdx % DE_LENGTH_OF_ARRAY(s_bias)];
614 gl.viewport(viewport.x+curX, viewport.y+curY, curW, curH);
615 m_renderer.renderQuad(0, &texCoord[0], params);
617 // Render reference(s).
619 tcu::SurfaceAccess idealDst(idealFrame, m_renderCtx.getRenderTarget().getPixelFormat(), curX, curY, curW, curH);
620 params.lodMode = LODMODE_EXACT;
621 sampleTexture(idealDst, m_texture->getRefTexture(), &texCoord[0], params);
626 glu::readPixels(m_renderCtx, viewport.x, viewport.y, renderedFrame.getAccess());
630 const int bestScoreDiff = (texWidth/16)*(texHeight/16);
631 const int worstScoreDiff = texWidth*texHeight;
633 int score = measureAccuracy(log, idealFrame, renderedFrame, bestScoreDiff, worstScoreDiff);
634 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, de::toString(score).c_str());
640 TextureMipmapTests::TextureMipmapTests (Context& context)
641 : TestCaseGroup(context, "mipmap", "Mipmapping accuracy tests")
645 TextureMipmapTests::~TextureMipmapTests (void)
649 void TextureMipmapTests::init (void)
651 tcu::TestCaseGroup* group2D = new tcu::TestCaseGroup(m_testCtx, "2d", "2D Texture Mipmapping");
652 tcu::TestCaseGroup* groupCube = new tcu::TestCaseGroup(m_testCtx, "cube", "Cube Map Filtering");
662 { "clamp", GL_CLAMP_TO_EDGE },
663 { "repeat", GL_REPEAT },
664 { "mirror", GL_MIRRORED_REPEAT }
673 { "nearest_nearest", GL_NEAREST_MIPMAP_NEAREST },
674 { "linear_nearest", GL_LINEAR_MIPMAP_NEAREST },
675 { "nearest_linear", GL_NEAREST_MIPMAP_LINEAR },
676 { "linear_linear", GL_LINEAR_MIPMAP_LINEAR }
686 { COORDTYPE_BASIC, "basic", "Mipmapping with translated and scaled coordinates" },
687 { COORDTYPE_AFFINE, "affine", "Mipmapping with affine coordinate transform" },
688 { COORDTYPE_PROJECTED, "projected", "Mipmapping with perspective projection" }
691 const int tex2DWidth = 64;
692 const int tex2DHeight = 64;
695 for (int coordType = 0; coordType < DE_LENGTH_OF_ARRAY(coordTypes); coordType++)
697 tcu::TestCaseGroup* coordTypeGroup = new tcu::TestCaseGroup(m_testCtx, coordTypes[coordType].name, coordTypes[coordType].desc);
698 group2D->addChild(coordTypeGroup);
700 for (int minFilter = 0; minFilter < DE_LENGTH_OF_ARRAY(minFilterModes); minFilter++)
702 for (int wrapMode = 0; wrapMode < DE_LENGTH_OF_ARRAY(wrapModes); wrapMode++)
704 std::ostringstream name;
705 name << minFilterModes[minFilter].name
706 << "_" << wrapModes[wrapMode].name;
708 coordTypeGroup->addChild(new Texture2DMipmapCase(m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(),
709 name.str().c_str(), "",
710 coordTypes[coordType].type,
711 minFilterModes[minFilter].mode,
712 wrapModes[wrapMode].mode,
713 wrapModes[wrapMode].mode,
714 GL_RGBA, GL_UNSIGNED_BYTE,
715 tex2DWidth, tex2DHeight));
720 const int cubeMapSize = 64;
729 { COORDTYPE_BASIC, "basic", "Mipmapping with translated and scaled coordinates" },
730 { COORDTYPE_PROJECTED, "projected", "Mipmapping with perspective projection" }
734 for (int coordType = 0; coordType < DE_LENGTH_OF_ARRAY(cubeCoordTypes); coordType++)
736 tcu::TestCaseGroup* coordTypeGroup = new tcu::TestCaseGroup(m_testCtx, cubeCoordTypes[coordType].name, cubeCoordTypes[coordType].desc);
737 groupCube->addChild(coordTypeGroup);
739 for (int minFilter = 0; minFilter < DE_LENGTH_OF_ARRAY(minFilterModes); minFilter++)
741 coordTypeGroup->addChild(new TextureCubeMipmapCase(m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(),
742 minFilterModes[minFilter].name, "",
743 cubeCoordTypes[coordType].type,
744 minFilterModes[minFilter].mode,
747 GL_RGBA, GL_UNSIGNED_BYTE, cubeMapSize));