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 "tcuVector.hpp"
33 #include "tcuMatrix.hpp"
34 #include "tcuMatrixUtil.hpp"
35 #include "deStringUtil.hpp"
36 #include "deRandom.hpp"
38 #include "glwEnums.hpp"
39 #include "glwFunctions.hpp"
58 using namespace gls::TextureTestUtil;
62 COORDTYPE_BASIC, //!< texCoord = translateScale(position).
63 COORDTYPE_BASIC_BIAS, //!< Like basic, but with bias values.
64 COORDTYPE_AFFINE, //!< texCoord = translateScaleRotateShear(position).
65 COORDTYPE_PROJECTED, //!< Projected coordinates, w != 1
70 // Texture2DMipmapCase
72 class Texture2DMipmapCase : public tcu::TestCase
76 Texture2DMipmapCase (tcu::TestContext& testCtx,
77 glu::RenderContext& renderCtx,
78 const glu::ContextInfo& renderCtxInfo,
89 ~Texture2DMipmapCase (void);
93 IterateResult iterate (void);
96 Texture2DMipmapCase (const Texture2DMipmapCase& other);
97 Texture2DMipmapCase& operator= (const Texture2DMipmapCase& other);
99 glu::RenderContext& m_renderCtx;
100 const glu::ContextInfo& m_renderCtxInfo;
102 CoordType m_coordType;
103 deUint32 m_minFilter;
111 glu::Texture2D* m_texture;
112 TextureRenderer m_renderer;
115 Texture2DMipmapCase::Texture2DMipmapCase (tcu::TestContext& testCtx,
116 glu::RenderContext& renderCtx,
117 const glu::ContextInfo& renderCtxInfo,
128 : TestCase (testCtx, tcu::NODETYPE_ACCURACY, name, desc)
129 , m_renderCtx (renderCtx)
130 , m_renderCtxInfo (renderCtxInfo)
131 , m_coordType (coordType)
132 , m_minFilter (minFilter)
136 , m_dataType (dataType)
139 , m_texture (DE_NULL)
140 , m_renderer (renderCtx, testCtx.getLog(), glu::GLSL_VERSION_100_ES,
141 renderCtxInfo.isFragmentHighPrecisionSupported() ? glu::PRECISION_HIGHP // Use highp if available.
142 : glu::PRECISION_MEDIUMP)
146 Texture2DMipmapCase::~Texture2DMipmapCase (void)
151 void Texture2DMipmapCase::init (void)
153 if (!m_renderCtxInfo.isFragmentHighPrecisionSupported())
154 m_testCtx.getLog() << TestLog::Message << "Warning: High precision not supported in fragment shaders." << TestLog::EndMessage;
156 m_texture = new Texture2D(m_renderCtx, m_format, m_dataType, m_width, m_height);
158 int numLevels = deLog2Floor32(de::max(m_width, m_height))+1;
160 // Fill texture with colored grid.
161 for (int levelNdx = 0; levelNdx < numLevels; levelNdx++)
163 deUint32 step = 0xff / (numLevels-1);
164 deUint32 inc = deClamp32(step*levelNdx, 0x00, 0xff);
165 deUint32 dec = 0xff - inc;
166 deUint32 rgb = (inc << 16) | (dec << 8) | 0xff;
167 deUint32 color = 0xff000000 | rgb;
169 m_texture->getRefTexture().allocLevel(levelNdx);
170 tcu::clear(m_texture->getRefTexture().getLevel(levelNdx), toVec4(tcu::RGBA(color)));
174 void Texture2DMipmapCase::deinit (void)
182 static void getBasicTexCoord2D (std::vector<float>& dst, int cellNdx)
190 { Vec2(-0.1f, 0.1f), Vec2( 0.8f, 1.0f) },
191 { Vec2(-0.3f, -0.6f), Vec2( 0.7f, 0.4f) },
192 { Vec2(-0.3f, 0.6f), Vec2( 0.7f, -0.9f) },
193 { Vec2(-0.8f, 0.6f), Vec2( 0.7f, -0.9f) },
195 { Vec2(-0.5f, -0.5f), Vec2( 1.5f, 1.5f) },
196 { Vec2( 1.0f, -1.0f), Vec2(-1.3f, 1.0f) },
197 { Vec2( 1.2f, -1.0f), Vec2(-1.3f, 1.6f) },
198 { Vec2( 2.2f, -1.1f), Vec2(-1.3f, 0.8f) },
200 { Vec2(-1.5f, 1.6f), Vec2( 1.7f, -1.4f) },
201 { Vec2( 2.0f, 1.6f), Vec2( 2.3f, -1.4f) },
202 { Vec2( 1.3f, -2.6f), Vec2(-2.7f, 2.9f) },
203 { Vec2(-0.8f, -6.6f), Vec2( 6.0f, -0.9f) },
205 { Vec2( -8.0f, 9.0f), Vec2( 8.3f, -7.0f) },
206 { Vec2(-16.0f, 10.0f), Vec2( 18.3f, 24.0f) },
207 { Vec2( 30.2f, 55.0f), Vec2(-24.3f, -1.6f) },
208 { Vec2(-33.2f, 64.1f), Vec2( 32.1f, -64.1f) },
211 DE_ASSERT(de::inBounds(cellNdx, 0, DE_LENGTH_OF_ARRAY(s_basicCoords)));
213 const Vec2& bottomLeft = s_basicCoords[cellNdx].bottomLeft;
214 const Vec2& topRight = s_basicCoords[cellNdx].topRight;
216 computeQuadTexCoord2D(dst, bottomLeft, topRight);
219 static void getAffineTexCoord2D (std::vector<float>& dst, int cellNdx)
221 // Use basic coords as base.
222 getBasicTexCoord2D(dst, cellNdx);
224 // Rotate based on cell index.
225 float angle = 2.0f*DE_PI * ((float)cellNdx / 16.0f);
226 tcu::Mat2 rotMatrix = tcu::rotationMatrix(angle);
228 // Second and third row are sheared.
229 float shearX = de::inRange(cellNdx, 4, 11) ? (float)(15-cellNdx) / 16.0f : 0.0f;
230 tcu::Mat2 shearMatrix = tcu::shearMatrix(tcu::Vec2(shearX, 0.0f));
232 tcu::Mat2 transform = rotMatrix * shearMatrix;
233 Vec2 p0 = transform * Vec2(dst[0], dst[1]);
234 Vec2 p1 = transform * Vec2(dst[2], dst[3]);
235 Vec2 p2 = transform * Vec2(dst[4], dst[5]);
236 Vec2 p3 = transform * Vec2(dst[6], dst[7]);
238 dst[0] = p0.x(); dst[1] = p0.y();
239 dst[2] = p1.x(); dst[3] = p1.y();
240 dst[4] = p2.x(); dst[5] = p2.y();
241 dst[6] = p3.x(); dst[7] = p3.y();
244 Texture2DMipmapCase::IterateResult Texture2DMipmapCase::iterate (void)
247 const deUint32 magFilter = GL_NEAREST;
249 const glw::Functions& gl = m_renderCtx.getFunctions();
250 TestLog& log = m_testCtx.getLog();
252 const tcu::Texture2D& refTexture = m_texture->getRefTexture();
253 const tcu::TextureFormat& texFmt = refTexture.getFormat();
254 tcu::TextureFormatInfo fmtInfo = tcu::getTextureFormatInfo(texFmt);
256 int texWidth = refTexture.getWidth();
257 int texHeight = refTexture.getHeight();
258 int defViewportWidth = texWidth*4;
259 int defViewportHeight = texHeight*4;
261 RandomViewport viewport (m_renderCtx.getRenderTarget(), defViewportWidth, defViewportHeight, deStringHash(getName()));
262 ReferenceParams sampleParams (TEXTURETYPE_2D);
263 vector<float> texCoord;
264 bool isProjected = m_coordType == COORDTYPE_PROJECTED;
265 bool useLodBias = m_coordType == COORDTYPE_BASIC_BIAS;
267 tcu::Surface renderedFrame (viewport.width, viewport.height);
269 // Accuracy cases test against ideal lod computation.
270 tcu::Surface idealFrame (viewport.width, viewport.height);
272 // Viewport is divided into 4x4 grid.
275 int cellWidth = viewport.width / gridWidth;
276 int cellHeight = viewport.height / gridHeight;
278 // Accuracy measurements are off unless we get the expected viewport size.
279 if (viewport.width < defViewportWidth || viewport.height < defViewportHeight)
280 throw tcu::NotSupportedError("Too small viewport", "", __FILE__, __LINE__);
282 // Sampling parameters.
283 sampleParams.sampler = glu::mapGLSampler(m_wrapS, m_wrapT, m_minFilter, magFilter);
284 sampleParams.samplerType = gls::TextureTestUtil::getSamplerType(m_texture->getRefTexture().getFormat());
285 sampleParams.colorBias = fmtInfo.lookupBias;
286 sampleParams.colorScale = fmtInfo.lookupScale;
287 sampleParams.flags = (isProjected ? ReferenceParams::PROJECTED : 0) | (useLodBias ? ReferenceParams::USE_BIAS : 0);
289 // Upload texture data.
293 gl.activeTexture(GL_TEXTURE0);
295 // Bind gradient texture and setup sampler parameters.
296 gl.bindTexture(GL_TEXTURE_2D, m_texture->getGLTexture());
297 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, m_wrapS);
298 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, m_wrapT);
299 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, m_minFilter);
300 gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magFilter);
302 GLU_EXPECT_NO_ERROR(gl.getError(), "After texture setup");
305 static const float s_bias[] = { 1.0f, -2.0f, 0.8f, -0.5f, 1.5f, 0.9f, 2.0f, 4.0f };
307 // Projection values.
308 static const Vec4 s_projections[] =
310 Vec4(1.2f, 1.0f, 0.7f, 1.0f),
311 Vec4(1.3f, 0.8f, 0.6f, 2.0f),
312 Vec4(0.8f, 1.0f, 1.7f, 0.6f),
313 Vec4(1.2f, 1.0f, 1.7f, 1.5f)
317 for (int gridY = 0; gridY < gridHeight; gridY++)
319 for (int gridX = 0; gridX < gridWidth; gridX++)
321 int curX = cellWidth*gridX;
322 int curY = cellHeight*gridY;
323 int curW = gridX+1 == gridWidth ? (viewport.width-curX) : cellWidth;
324 int curH = gridY+1 == gridHeight ? (viewport.height-curY) : cellHeight;
325 int cellNdx = gridY*gridWidth + gridX;
330 case COORDTYPE_BASIC_BIAS: // Fall-through.
331 case COORDTYPE_PROJECTED:
332 case COORDTYPE_BASIC: getBasicTexCoord2D (texCoord, cellNdx); break;
333 case COORDTYPE_AFFINE: getAffineTexCoord2D (texCoord, cellNdx); break;
334 default: DE_ASSERT(DE_FALSE);
338 sampleParams.w = s_projections[cellNdx % DE_LENGTH_OF_ARRAY(s_projections)];
341 sampleParams.bias = s_bias[cellNdx % DE_LENGTH_OF_ARRAY(s_bias)];
344 gl.viewport(viewport.x+curX, viewport.y+curY, curW, curH);
345 m_renderer.renderQuad(0, &texCoord[0], sampleParams);
347 // Render reference(s).
349 SurfaceAccess idealDst(idealFrame, m_renderCtx.getRenderTarget().getPixelFormat(), curX, curY, curW, curH);
350 sampleParams.lodMode = LODMODE_EXACT;
351 sampleTexture(idealDst, m_texture->getRefTexture(), &texCoord[0], sampleParams);
357 glu::readPixels(m_renderCtx, viewport.x, viewport.y, renderedFrame.getAccess());
361 const int bestScoreDiff = (texWidth/16)*(texHeight/16);
362 const int worstScoreDiff = texWidth*texHeight;
364 int score = measureAccuracy(log, idealFrame, renderedFrame, bestScoreDiff, worstScoreDiff);
365 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, de::toString(score).c_str());
371 // TextureCubeMipmapCase
373 class TextureCubeMipmapCase : public tcu::TestCase
377 TextureCubeMipmapCase (tcu::TestContext& testCtx,
378 glu::RenderContext& renderCtx,
379 const glu::ContextInfo& renderCtxInfo,
389 ~TextureCubeMipmapCase (void);
393 IterateResult iterate (void);
396 TextureCubeMipmapCase (const TextureCubeMipmapCase& other);
397 TextureCubeMipmapCase& operator= (const TextureCubeMipmapCase& other);
399 glu::RenderContext& m_renderCtx;
400 const glu::ContextInfo& m_renderCtxInfo;
402 CoordType m_coordType;
403 deUint32 m_minFilter;
410 glu::TextureCube* m_texture;
411 TextureRenderer m_renderer;
414 TextureCubeMipmapCase::TextureCubeMipmapCase (tcu::TestContext& testCtx,
415 glu::RenderContext& renderCtx,
416 const glu::ContextInfo& renderCtxInfo,
426 : TestCase (testCtx, tcu::NODETYPE_ACCURACY, name, desc)
427 , m_renderCtx (renderCtx)
428 , m_renderCtxInfo (renderCtxInfo)
429 , m_coordType (coordType)
430 , m_minFilter (minFilter)
434 , m_dataType (dataType)
436 , m_texture (DE_NULL)
437 , m_renderer (renderCtx, testCtx.getLog(), glu::GLSL_VERSION_100_ES,
438 renderCtxInfo.isFragmentHighPrecisionSupported() ? glu::PRECISION_HIGHP // Use highp if available.
439 : glu::PRECISION_MEDIUMP)
443 TextureCubeMipmapCase::~TextureCubeMipmapCase (void)
448 void TextureCubeMipmapCase::init (void)
450 if (!m_renderCtxInfo.isFragmentHighPrecisionSupported())
451 m_testCtx.getLog() << TestLog::Message << "Warning: High precision not supported in fragment shaders." << TestLog::EndMessage;
453 m_texture = new TextureCube(m_renderCtx, m_format, m_dataType, m_size);
455 int numLevels = deLog2Floor32(m_size)+1;
457 // Fill texture with colored grid.
458 for (int faceNdx = 0; faceNdx < tcu::CUBEFACE_LAST; faceNdx++)
460 for (int levelNdx = 0; levelNdx < numLevels; levelNdx++)
462 deUint32 step = 0xff / (numLevels-1);
463 deUint32 inc = deClamp32(step*levelNdx, 0x00, 0xff);
464 deUint32 dec = 0xff - inc;
469 case 0: rgb = (inc << 16) | (dec << 8) | 255; break;
470 case 1: rgb = (255 << 16) | (inc << 8) | dec; break;
471 case 2: rgb = (dec << 16) | (255 << 8) | inc; break;
472 case 3: rgb = (dec << 16) | (inc << 8) | 255; break;
473 case 4: rgb = (255 << 16) | (dec << 8) | inc; break;
474 case 5: rgb = (inc << 16) | (255 << 8) | dec; break;
477 deUint32 color = 0xff000000 | rgb;
479 m_texture->getRefTexture().allocLevel((tcu::CubeFace)faceNdx, levelNdx);
480 tcu::clear(m_texture->getRefTexture().getLevelFace(levelNdx, (tcu::CubeFace)faceNdx), toVec4(tcu::RGBA(color)));
485 void TextureCubeMipmapCase::deinit (void)
493 static void randomPartition (vector<IVec4>& dst, de::Random& rnd, int x, int y, int width, int height)
495 const int minWidth = 8;
496 const int minHeight = 8;
498 bool partition = rnd.getFloat() > 0.4f;
499 bool partitionX = partition && width > minWidth && rnd.getBool();
500 bool partitionY = partition && height > minHeight && !partitionX;
504 int split = width/2 + rnd.getInt(-width/4, +width/4);
505 randomPartition(dst, rnd, x, y, split, height);
506 randomPartition(dst, rnd, x+split, y, width-split, height);
510 int split = height/2 + rnd.getInt(-height/4, +height/4);
511 randomPartition(dst, rnd, x, y, width, split);
512 randomPartition(dst, rnd, x, y+split, width, height-split);
515 dst.push_back(IVec4(x, y, width, height));
518 static void computeGridLayout (vector<IVec4>& dst, int width, int height)
521 randomPartition(dst, rnd, 0, 0, width, height);
524 TextureCubeMipmapCase::IterateResult TextureCubeMipmapCase::iterate (void)
527 const deUint32 magFilter = GL_NEAREST;
529 int texWidth = m_texture->getRefTexture().getSize();
530 int texHeight = m_texture->getRefTexture().getSize();
532 int defViewportWidth = texWidth*2;
533 int defViewportHeight = texHeight*2;
535 const glw::Functions& gl = m_renderCtx.getFunctions();
536 TestLog& log = m_testCtx.getLog();
537 RandomViewport viewport (m_renderCtx.getRenderTarget(), defViewportWidth, defViewportHeight, deStringHash(getName()));
538 tcu::Sampler sampler = mapGLSampler(m_wrapS, m_wrapT, m_minFilter, magFilter);
540 vector<float> texCoord;
542 bool isProjected = m_coordType == COORDTYPE_PROJECTED;
543 bool useLodBias = m_coordType == COORDTYPE_BASIC_BIAS;
545 tcu::Surface renderedFrame (viewport.width, viewport.height);
547 // Accuracy cases test against ideal lod computation.
548 tcu::Surface idealFrame (viewport.width, viewport.height);
550 // Accuracy measurements are off unless we get the expected viewport size.
551 if (viewport.width < defViewportWidth || viewport.height < defViewportHeight)
552 throw tcu::NotSupportedError("Too small viewport", "", __FILE__, __LINE__);
554 // Upload texture data.
558 gl.activeTexture(GL_TEXTURE0);
560 // Bind gradient texture and setup sampler parameters.
561 gl.bindTexture(GL_TEXTURE_CUBE_MAP, m_texture->getGLTexture());
562 gl.texParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, m_wrapS);
563 gl.texParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, m_wrapT);
564 gl.texParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, m_minFilter);
565 gl.texParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, magFilter);
567 GLU_EXPECT_NO_ERROR(gl.getError(), "After texture setup");
570 vector<IVec4> gridLayout;
571 computeGridLayout(gridLayout, viewport.width, viewport.height);
574 static const float s_bias[] = { 1.0f, -2.0f, 0.8f, -0.5f, 1.5f, 0.9f, 2.0f, 4.0f };
576 // Projection values \note Less agressive than in 2D case due to smaller quads.
577 static const Vec4 s_projections[] =
579 Vec4(1.2f, 1.0f, 0.7f, 1.0f),
580 Vec4(1.3f, 0.8f, 0.6f, 1.1f),
581 Vec4(0.8f, 1.0f, 1.2f, 0.8f),
582 Vec4(1.2f, 1.0f, 1.3f, 0.9f)
585 for (int cellNdx = 0; cellNdx < (int)gridLayout.size(); cellNdx++)
587 int curX = gridLayout[cellNdx].x();
588 int curY = gridLayout[cellNdx].y();
589 int curW = gridLayout[cellNdx].z();
590 int curH = gridLayout[cellNdx].w();
591 tcu::CubeFace cubeFace = (tcu::CubeFace)(cellNdx % tcu::CUBEFACE_LAST);
592 ReferenceParams params (TEXTURETYPE_CUBE);
594 params.sampler = sampler;
596 DE_ASSERT(m_coordType != COORDTYPE_AFFINE); // Not supported.
597 computeQuadTexCoordCube(texCoord, cubeFace);
601 params.flags |= ReferenceParams::PROJECTED;
602 params.w = s_projections[cellNdx % DE_LENGTH_OF_ARRAY(s_projections)];
607 params.flags |= ReferenceParams::USE_BIAS;
608 params.bias = s_bias[cellNdx % DE_LENGTH_OF_ARRAY(s_bias)];
612 gl.viewport(viewport.x+curX, viewport.y+curY, curW, curH);
613 m_renderer.renderQuad(0, &texCoord[0], params);
615 // Render reference(s).
617 SurfaceAccess idealDst(idealFrame, m_renderCtx.getRenderTarget().getPixelFormat(), curX, curY, curW, curH);
618 params.lodMode = LODMODE_EXACT;
619 sampleTexture(idealDst, m_texture->getRefTexture(), &texCoord[0], params);
624 glu::readPixels(m_renderCtx, viewport.x, viewport.y, renderedFrame.getAccess());
628 const int bestScoreDiff = (texWidth/16)*(texHeight/16);
629 const int worstScoreDiff = texWidth*texHeight;
631 int score = measureAccuracy(log, idealFrame, renderedFrame, bestScoreDiff, worstScoreDiff);
632 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, de::toString(score).c_str());
638 TextureMipmapTests::TextureMipmapTests (Context& context)
639 : TestCaseGroup(context, "mipmap", "Mipmapping accuracy tests")
643 TextureMipmapTests::~TextureMipmapTests (void)
647 void TextureMipmapTests::init (void)
649 tcu::TestCaseGroup* group2D = new tcu::TestCaseGroup(m_testCtx, "2d", "2D Texture Mipmapping");
650 tcu::TestCaseGroup* groupCube = new tcu::TestCaseGroup(m_testCtx, "cube", "Cube Map Filtering");
660 { "clamp", GL_CLAMP_TO_EDGE },
661 { "repeat", GL_REPEAT },
662 { "mirror", GL_MIRRORED_REPEAT }
671 { "nearest_nearest", GL_NEAREST_MIPMAP_NEAREST },
672 { "linear_nearest", GL_LINEAR_MIPMAP_NEAREST },
673 { "nearest_linear", GL_NEAREST_MIPMAP_LINEAR },
674 { "linear_linear", GL_LINEAR_MIPMAP_LINEAR }
684 { COORDTYPE_BASIC, "basic", "Mipmapping with translated and scaled coordinates" },
685 { COORDTYPE_AFFINE, "affine", "Mipmapping with affine coordinate transform" },
686 { COORDTYPE_PROJECTED, "projected", "Mipmapping with perspective projection" }
689 const int tex2DWidth = 64;
690 const int tex2DHeight = 64;
693 for (int coordType = 0; coordType < DE_LENGTH_OF_ARRAY(coordTypes); coordType++)
695 tcu::TestCaseGroup* coordTypeGroup = new tcu::TestCaseGroup(m_testCtx, coordTypes[coordType].name, coordTypes[coordType].desc);
696 group2D->addChild(coordTypeGroup);
698 for (int minFilter = 0; minFilter < DE_LENGTH_OF_ARRAY(minFilterModes); minFilter++)
700 for (int wrapMode = 0; wrapMode < DE_LENGTH_OF_ARRAY(wrapModes); wrapMode++)
702 std::ostringstream name;
703 name << minFilterModes[minFilter].name
704 << "_" << wrapModes[wrapMode].name;
706 coordTypeGroup->addChild(new Texture2DMipmapCase(m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(),
707 name.str().c_str(), "",
708 coordTypes[coordType].type,
709 minFilterModes[minFilter].mode,
710 wrapModes[wrapMode].mode,
711 wrapModes[wrapMode].mode,
712 GL_RGBA, GL_UNSIGNED_BYTE,
713 tex2DWidth, tex2DHeight));
718 const int cubeMapSize = 64;
727 { COORDTYPE_BASIC, "basic", "Mipmapping with translated and scaled coordinates" },
728 { COORDTYPE_PROJECTED, "projected", "Mipmapping with perspective projection" }
732 for (int coordType = 0; coordType < DE_LENGTH_OF_ARRAY(cubeCoordTypes); coordType++)
734 tcu::TestCaseGroup* coordTypeGroup = new tcu::TestCaseGroup(m_testCtx, cubeCoordTypes[coordType].name, cubeCoordTypes[coordType].desc);
735 groupCube->addChild(coordTypeGroup);
737 for (int minFilter = 0; minFilter < DE_LENGTH_OF_ARRAY(minFilterModes); minFilter++)
739 coordTypeGroup->addChild(new TextureCubeMipmapCase(m_testCtx, m_context.getRenderContext(), m_context.getContextInfo(),
740 minFilterModes[minFilter].name, "",
741 cubeCoordTypes[coordType].type,
742 minFilterModes[minFilter].mode,
745 GL_RGBA, GL_UNSIGNED_BYTE, cubeMapSize));