1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL (ES) 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 Framebuffer completeness tests.
22 *//*--------------------------------------------------------------------*/
24 #include "glsFboCompletenessTests.hpp"
26 #include "gluStrUtil.hpp"
27 #include "gluObjectWrapper.hpp"
28 #include "deStringUtil.hpp"
35 using glu::RenderContext;
36 using glu::getFramebufferStatusName;
37 using glu::getPixelFormatName;
38 using glu::getTypeName;
39 using glu::getErrorName;
40 using glu::Framebuffer;
42 using tcu::TestCaseGroup;
44 using tcu::MessageBuilder;
48 using namespace deqp::gls::FboUtil;
49 using namespace deqp::gls::FboUtil::config;
50 typedef TestCase::IterateResult IterateResult;
61 // \todo [2013-12-04 lauri] Place in deStrUtil.hpp?
63 string toLower (const string& str)
66 std::transform(str.begin(), str.end(), std::inserter(ret, ret.begin()), ::tolower);
70 // The following extensions are applicable both to ES2 and ES3.
72 // GL_OES_depth_texture
73 static const FormatKey s_oesDepthTextureFormats[] =
75 GLS_UNSIZED_FORMATKEY(GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT),
76 GLS_UNSIZED_FORMATKEY(GL_DEPTH_COMPONENT, GL_UNSIGNED_INT),
79 // GL_OES_packed_depth_stencil
80 static const FormatKey s_oesPackedDepthStencilSizedFormats[] =
85 static const FormatKey s_oesPackedDepthStencilTexFormats[] =
87 GLS_UNSIZED_FORMATKEY(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8),
90 // GL_OES_required_internalformat
91 static const FormatKey s_oesRequiredInternalFormatColorFormats[] =
93 // Same as ES2 RBO formats, plus RGBA8 (even without OES_rgb8_rgba8)
94 GL_RGB5_A1, GL_RGBA8, GL_RGBA4, GL_RGB565
97 static const FormatKey s_oesRequiredInternalFormatDepthFormats[] =
102 // GL_EXT_color_buffer_half_float
103 static const FormatKey s_extColorBufferHalfFloatFormats[] =
105 GL_RGBA16F, GL_RGB16F, GL_RG16F, GL_R16F,
108 static const FormatKey s_oesDepth24SizedFormats[] =
113 static const FormatKey s_oesDepth32SizedFormats[] =
118 static const FormatKey s_oesRgb8Rgba8RboFormats[] =
124 static const FormatKey s_oesRequiredInternalFormatRgb8ColorFormat[] =
129 static const FormatKey s_extTextureType2101010RevFormats[] =
131 GLS_UNSIZED_FORMATKEY(GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV),
132 GLS_UNSIZED_FORMATKEY(GL_RGB, GL_UNSIGNED_INT_2_10_10_10_REV),
135 static const FormatKey s_oesRequiredInternalFormat10bitColorFormats[] =
137 GL_RGB10_A2, GL_RGB10,
140 static const FormatKey s_extTextureRgRboFormats[] =
145 static const FormatKey s_extTextureRgTexFormats[] =
147 GLS_UNSIZED_FORMATKEY(GL_RED, GL_UNSIGNED_BYTE),
148 GLS_UNSIZED_FORMATKEY(GL_RG, GL_UNSIGNED_BYTE),
151 static const FormatKey s_extTextureRgFloatTexFormats[] =
153 GLS_UNSIZED_FORMATKEY(GL_RED, GL_FLOAT),
154 GLS_UNSIZED_FORMATKEY(GL_RG, GL_FLOAT),
157 static const FormatKey s_extTextureRgHalfFloatTexFormats[] =
159 GLS_UNSIZED_FORMATKEY(GL_RED, GL_HALF_FLOAT_OES),
160 GLS_UNSIZED_FORMATKEY(GL_RG, GL_HALF_FLOAT_OES),
163 static const FormatKey s_nvPackedFloatRboFormats[] =
168 static const FormatKey s_nvPackedFloatTexFormats[] =
170 GLS_UNSIZED_FORMATKEY(GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV),
173 static const FormatKey s_extSrgbRboFormats[] =
178 static const FormatKey s_extSrgbTexFormats[] =
180 GLS_UNSIZED_FORMATKEY(GL_SRGB, GL_UNSIGNED_BYTE),
181 GLS_UNSIZED_FORMATKEY(GL_SRGB_ALPHA, GL_UNSIGNED_BYTE),
184 static const FormatKey s_oesRgb8Rgba8TexFormats[] =
186 GLS_UNSIZED_FORMATKEY(GL_RGB, GL_UNSIGNED_BYTE),
187 GLS_UNSIZED_FORMATKEY(GL_RGBA, GL_UNSIGNED_BYTE),
190 static const FormatExtEntry s_esExtFormats[] =
193 "GL_OES_depth_texture",
194 REQUIRED_RENDERABLE | DEPTH_RENDERABLE | TEXTURE_VALID,
195 GLS_ARRAY_RANGE(s_oesDepthTextureFormats),
198 "GL_OES_packed_depth_stencil",
199 REQUIRED_RENDERABLE | DEPTH_RENDERABLE | STENCIL_RENDERABLE | RENDERBUFFER_VALID,
200 GLS_ARRAY_RANGE(s_oesPackedDepthStencilSizedFormats)
203 "GL_OES_packed_depth_stencil GL_OES_required_internalformat",
205 GLS_ARRAY_RANGE(s_oesPackedDepthStencilSizedFormats)
208 "GL_OES_packed_depth_stencil",
209 DEPTH_RENDERABLE | STENCIL_RENDERABLE | TEXTURE_VALID,
210 GLS_ARRAY_RANGE(s_oesPackedDepthStencilTexFormats)
212 // \todo [2013-12-10 lauri] Find out if OES_texture_half_float is really a
213 // requirement on ES3 also. Or is color_buffer_half_float applicatble at
214 // all on ES3, since there's also EXT_color_buffer_float?
216 "GL_OES_texture_half_float GL_EXT_color_buffer_half_float",
217 REQUIRED_RENDERABLE | COLOR_RENDERABLE | RENDERBUFFER_VALID,
218 GLS_ARRAY_RANGE(s_extColorBufferHalfFloatFormats)
221 // OES_required_internalformat doesn't actually specify that these are renderable,
222 // since it was written against ES 1.1.
224 "GL_OES_required_internalformat",
225 // Allow but don't require RGBA8 to be color-renderable if
226 // OES_rgb8_rgba8 is not present.
227 COLOR_RENDERABLE | TEXTURE_VALID,
228 GLS_ARRAY_RANGE(s_oesRequiredInternalFormatColorFormats)
231 "GL_OES_required_internalformat",
232 DEPTH_RENDERABLE | TEXTURE_VALID,
233 GLS_ARRAY_RANGE(s_oesRequiredInternalFormatDepthFormats)
237 REQUIRED_RENDERABLE | COLOR_RENDERABLE | RENDERBUFFER_VALID,
238 GLS_ARRAY_RANGE(s_extTextureRgRboFormats)
240 // These are not specified to be color-renderable, but the wording is
241 // exactly as ambiguous as the wording in the ES2 spec.
244 COLOR_RENDERABLE | TEXTURE_VALID,
245 GLS_ARRAY_RANGE(s_extTextureRgTexFormats)
248 "GL_EXT_texture_rg GL_OES_texture_float",
249 COLOR_RENDERABLE | TEXTURE_VALID,
250 GLS_ARRAY_RANGE(s_extTextureRgFloatTexFormats)
253 "GL_EXT_texture_rg GL_OES_texture_half_float",
254 COLOR_RENDERABLE | TEXTURE_VALID,
255 GLS_ARRAY_RANGE(s_extTextureRgHalfFloatTexFormats)
259 "GL_NV_packed_float",
260 COLOR_RENDERABLE | TEXTURE_VALID,
261 GLS_ARRAY_RANGE(s_nvPackedFloatTexFormats)
264 "GL_NV_packed_float GL_EXT_color_buffer_half_float",
265 REQUIRED_RENDERABLE | COLOR_RENDERABLE | RENDERBUFFER_VALID,
266 GLS_ARRAY_RANGE(s_nvPackedFloatRboFormats)
269 // Some Tegra drivers report GL_EXT_packed_float even for ES. Treat it as
270 // a synonym for the NV_ version.
272 "GL_EXT_packed_float",
273 COLOR_RENDERABLE | TEXTURE_VALID,
274 GLS_ARRAY_RANGE(s_nvPackedFloatTexFormats)
277 "GL_EXT_packed_float GL_EXT_color_buffer_half_float",
278 REQUIRED_RENDERABLE | COLOR_RENDERABLE | RENDERBUFFER_VALID,
279 GLS_ARRAY_RANGE(s_nvPackedFloatRboFormats)
284 COLOR_RENDERABLE | TEXTURE_VALID,
285 GLS_ARRAY_RANGE(s_extSrgbTexFormats)
289 REQUIRED_RENDERABLE | COLOR_RENDERABLE | RENDERBUFFER_VALID,
290 GLS_ARRAY_RANGE(s_extSrgbRboFormats)
293 // In Khronos bug 7333 discussion, the consensus is that these texture
294 // formats, at least, should be color-renderable. Still, that cannot be
295 // found in any extension specs, so only allow it, not require it.
298 COLOR_RENDERABLE | TEXTURE_VALID,
299 GLS_ARRAY_RANGE(s_oesRgb8Rgba8TexFormats)
303 REQUIRED_RENDERABLE | COLOR_RENDERABLE | RENDERBUFFER_VALID,
304 GLS_ARRAY_RANGE(s_oesRgb8Rgba8RboFormats)
307 "GL_OES_rgb8_rgba8 GL_OES_required_internalformat",
309 GLS_ARRAY_RANGE(s_oesRequiredInternalFormatRgb8ColorFormat)
312 // The depth-renderability of the depth RBO formats is not explicitly
313 // spelled out, but all renderbuffer formats are meant to be renderable.
316 REQUIRED_RENDERABLE | DEPTH_RENDERABLE | RENDERBUFFER_VALID,
317 GLS_ARRAY_RANGE(s_oesDepth24SizedFormats)
320 "GL_OES_depth24 GL_OES_required_internalformat GL_OES_depth_texture",
322 GLS_ARRAY_RANGE(s_oesDepth24SizedFormats)
327 REQUIRED_RENDERABLE | DEPTH_RENDERABLE | RENDERBUFFER_VALID,
328 GLS_ARRAY_RANGE(s_oesDepth32SizedFormats)
331 "GL_OES_depth32 GL_OES_required_internalformat GL_OES_depth_texture",
333 GLS_ARRAY_RANGE(s_oesDepth32SizedFormats)
337 "GL_EXT_texture_type_2_10_10_10_REV",
338 TEXTURE_VALID, // explicitly unrenderable
339 GLS_ARRAY_RANGE(s_extTextureType2101010RevFormats)
342 "GL_EXT_texture_type_2_10_10_10_REV GL_OES_required_internalformat",
343 TEXTURE_VALID, // explicitly unrenderable
344 GLS_ARRAY_RANGE(s_oesRequiredInternalFormat10bitColorFormats)
348 Context::Context (TestContext& testCtx,
349 RenderContext& renderCtx,
350 CheckerFactory& factory)
351 : m_testCtx (testCtx)
352 , m_renderCtx (renderCtx)
353 , m_verifier (m_ctxFormats, factory)
354 , m_haveMultiColorAtts (false)
356 FormatExtEntries extRange = GLS_ARRAY_RANGE(s_esExtFormats);
357 addExtFormats(extRange);
360 void Context::addFormats (FormatEntries fmtRange)
362 FboUtil::addFormats(m_minFormats, fmtRange);
363 FboUtil::addFormats(m_ctxFormats, fmtRange);
364 FboUtil::addFormats(m_maxFormats, fmtRange);
367 void Context::addExtFormats (FormatExtEntries extRange)
369 FboUtil::addExtFormats(m_ctxFormats, extRange, &m_renderCtx);
370 FboUtil::addExtFormats(m_maxFormats, extRange, DE_NULL);
373 void TestBase::pass (void)
375 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
378 void TestBase::qualityWarning (const char* msg)
380 m_testCtx.setTestResult(QP_TEST_RESULT_QUALITY_WARNING, msg);
383 void TestBase::fail (const char* msg)
385 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, msg);
388 static string statusName (GLenum status)
390 const char* errorName = getErrorName(status);
391 if (status != GL_NO_ERROR && errorName != DE_NULL)
392 return string(errorName) + " (during FBO initialization)";
394 const char* fbStatusName = getFramebufferStatusName(status);
395 if (fbStatusName != DE_NULL)
398 return "unknown value (" + toString(status) + ")";
401 const glw::Functions& gl (const TestBase& test)
403 return test.getContext().getRenderContext().getFunctions();
406 IterateResult TestBase::iterate (void)
408 glu::Framebuffer fbo(m_ctx.getRenderContext());
409 FboBuilder builder(*fbo, GL_FRAMEBUFFER, gl(*this));
410 const IterateResult ret = build(builder);
411 const StatusCodes statuses = m_ctx.getVerifier().validStatusCodes(builder);
413 GLenum glStatus = builder.getError();
414 if (glStatus == GL_NO_ERROR)
415 glStatus = gl(*this).checkFramebufferStatus(GL_FRAMEBUFFER);
417 // \todo [2013-12-04 lauri] Check if drawing operations succeed.
419 StatusCodes::const_iterator it = statuses.begin();
421 logFramebufferConfig(builder, m_testCtx.getLog());
423 MessageBuilder msg(&m_testCtx.getLog());
426 if (it != statuses.end())
429 while (it != statuses.end())
431 msg << statusName(err);
433 msg << (it == statuses.end() ? " or " : ", ");
436 msg << statusName(err) << "." << TestLog::EndMessage;
437 m_testCtx.getLog() << TestLog::Message << "Received " << statusName(glStatus)
438 << "." << TestLog::EndMessage;
440 if (!contains(statuses, glStatus))
442 // The returned status value was not acceptable.
443 if (glStatus == GL_FRAMEBUFFER_COMPLETE)
444 fail("Framebuffer checked as complete, expected incomplete");
445 else if (statuses.size() == 1 && contains(statuses, GL_FRAMEBUFFER_COMPLETE))
446 fail("Framebuffer checked is incomplete, expected complete");
448 // An incomplete status is allowed, but not _this_ incomplete status.
449 fail("Framebuffer checked as incomplete, but with wrong status");
451 else if (glStatus != GL_FRAMEBUFFER_COMPLETE &&
452 contains(statuses, GL_FRAMEBUFFER_COMPLETE))
454 qualityWarning("Framebuffer object could have checked as complete but did not.");
462 IterateResult TestBase::build (FboBuilder& builder)
468 ImageFormat TestBase::getDefaultFormat (GLenum attPoint, GLenum bufType) const
470 if (bufType == GL_NONE)
472 return ImageFormat::none();
475 // Prefer a standard format, if there is one, but if not, use a format
476 // provided by an extension.
477 Formats formats = m_ctx.getMinFormats().getFormats(formatFlag(attPoint) |
478 formatFlag(bufType));
479 Formats::const_iterator it = formats.begin();
480 if (it == formats.end())
482 formats = m_ctx.getCtxFormats().getFormats(formatFlag(attPoint) |
483 formatFlag(bufType));
484 it = formats.begin();
486 if (it == formats.end())
487 throw tcu::NotSupportedError("Unsupported attachment kind for attachment point",
488 "", __FILE__, __LINE__);
492 Image* makeImage (GLenum bufType, ImageFormat format,
493 GLsizei width, GLsizei height, FboBuilder& builder)
495 Image* image = DE_NULL;
500 case GL_RENDERBUFFER:
501 image = &builder.makeConfig<Renderbuffer>();
504 image = &builder.makeConfig<Texture2D>();
507 DE_ASSERT(!"Impossible case");
509 image->internalFormat = format;
510 image->width = width;
511 image->height = height;
515 Attachment* makeAttachment (GLenum bufType, ImageFormat format,
516 GLsizei width, GLsizei height, FboBuilder& builder)
518 Image* const imgCfg = makeImage (bufType, format, width, height, builder);
519 Attachment* att = DE_NULL;
522 if (Renderbuffer* rboCfg = dynamic_cast<Renderbuffer*>(imgCfg))
524 img = builder.glCreateRbo(*rboCfg);
525 att = &builder.makeConfig<RenderbufferAttachment>();
527 else if (Texture2D* texCfg = dynamic_cast<Texture2D*>(imgCfg))
529 img = builder.glCreateTexture(*texCfg);
530 TextureFlatAttachment& texAtt = builder.makeConfig<TextureFlatAttachment>();
531 texAtt.texTarget = GL_TEXTURE_2D;
536 DE_ASSERT(imgCfg == DE_NULL);
539 att->imageName = img;
543 void TestBase::attachTargetToNew (GLenum target, GLenum bufType, ImageFormat format,
544 GLsizei width, GLsizei height, FboBuilder& builder)
546 ImageFormat imgFmt = format;
547 if (imgFmt.format == GL_NONE)
548 imgFmt = getDefaultFormat(target, bufType);
550 const Attachment* const att = makeAttachment(bufType, imgFmt, width, height, builder);
551 builder.glAttach(target, att);
554 static string formatName (ImageFormat format)
556 const string s = getPixelFormatName(format.format);
557 const string fmtStr = toLower(s.substr(3));
559 if (format.unsizedType != GL_NONE)
561 const string typeStr = getTypeName(format.unsizedType);
562 return fmtStr + "_" + toLower(typeStr.substr(3));
568 static string formatDesc (ImageFormat format)
570 const string fmtStr = getPixelFormatName(format.format);
572 if (format.unsizedType != GL_NONE)
574 const string typeStr = getTypeName(format.unsizedType);
575 return fmtStr + " with type " + typeStr;
581 struct RenderableParams
586 static string getName (const RenderableParams& params)
588 return formatName(params.format);
590 static string getDescription (const RenderableParams& params)
592 return formatDesc(params.format);
596 class RenderableTest : public ParamTest<RenderableParams>
599 RenderableTest (Context& group, const Params& params)
600 : ParamTest<RenderableParams> (group, params) {}
601 IterateResult build (FboBuilder& builder);
604 IterateResult RenderableTest::build (FboBuilder& builder)
606 attachTargetToNew(m_params.attPoint, m_params.bufType, m_params.format, 64, 64, builder);
610 string attTypeName (GLenum bufType)
616 case GL_RENDERBUFFER:
621 DE_ASSERT(!"Impossible case");
623 return ""; // Shut up compiler
626 struct AttachmentParams
633 static string getName (const AttachmentParams& params);
634 static string getDescription (const AttachmentParams& params)
636 return getName(params);
640 string AttachmentParams::getName (const AttachmentParams& params)
642 return (attTypeName(params.color0Kind) + "_" +
643 attTypeName(params.colornKind) + "_" +
644 attTypeName(params.depthKind) + "_" +
645 attTypeName(params.stencilKind));
648 //! Test for combinations of different kinds of attachments
649 class AttachmentTest : public ParamTest<AttachmentParams>
652 AttachmentTest (Context& group, Params& params)
653 : ParamTest<AttachmentParams> (group, params) {}
656 IterateResult build (FboBuilder& builder);
657 void makeDepthAndStencil (FboBuilder& builder);
661 void AttachmentTest::makeDepthAndStencil (FboBuilder& builder)
663 if (m_params.stencilKind == m_params.depthKind)
665 // If there is a common stencil+depth -format, try to use a common
666 // image for both attachments.
667 const FormatFlags flags =
668 DEPTH_RENDERABLE | STENCIL_RENDERABLE | formatFlag(m_params.stencilKind);
669 const Formats& formats = m_ctx.getMinFormats().getFormats(flags);
670 Formats::const_iterator it = formats.begin();
671 if (it != formats.end())
673 const ImageFormat format = *it;
674 Attachment* att = makeAttachment(m_params.depthKind, format, 64, 64, builder);
675 builder.glAttach(GL_DEPTH_ATTACHMENT, att);
676 builder.glAttach(GL_STENCIL_ATTACHMENT, att);
680 // Either the kinds were separate, or a suitable format was not found.
681 // Create separate images.
682 attachTargetToNew(GL_STENCIL_ATTACHMENT, m_params.stencilKind, ImageFormat::none(),
684 attachTargetToNew(GL_DEPTH_ATTACHMENT, m_params.depthKind, ImageFormat::none(),
688 IterateResult AttachmentTest::build (FboBuilder& builder)
690 attachTargetToNew(GL_COLOR_ATTACHMENT0, m_params.color0Kind, ImageFormat::none(),
693 if (m_params.colornKind != GL_NONE)
695 TCU_CHECK_AND_THROW(NotSupportedError, m_ctx.haveMultiColorAtts(),
696 "Multiple attachments not supported");
697 GLint maxAttachments = 1;
698 gl(*this).getIntegerv(GL_MAX_COLOR_ATTACHMENTS, &maxAttachments);
700 gl(*this).getError(), "Couldn't read GL_MAX_COLOR_ATTACHMENTS");
702 for (int i = 1; i < maxAttachments; i++)
704 attachTargetToNew(GL_COLOR_ATTACHMENT0 + i, m_params.colornKind,
705 ImageFormat::none(), 64, 64, builder);
709 makeDepthAndStencil(builder);
714 class EmptyImageTest : public TestBase
717 EmptyImageTest (Context& group,
718 const char* name, const char* desc)
719 : TestBase (group, name, desc) {}
721 IterateResult build (FboBuilder& builder);
724 IterateResult EmptyImageTest::build (FboBuilder& builder)
726 attachTargetToNew(GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, ImageFormat::none(),
732 class DistinctSizeTest : public TestBase
735 DistinctSizeTest (Context& group,
736 const char* name, const char* desc)
737 : TestBase (group, name, desc) {}
739 IterateResult build (FboBuilder& builder);
742 IterateResult DistinctSizeTest::build (FboBuilder& builder)
744 attachTargetToNew(GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, ImageFormat::none(),
746 attachTargetToNew(GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, ImageFormat::none(),
751 TestCaseGroup* Context::createRenderableTests (void)
753 TestCaseGroup* const renderableTests = new TestCaseGroup(
754 m_testCtx, "renderable", "Tests for support of renderable image formats");
756 TestCaseGroup* const rbRenderableTests = new TestCaseGroup(
757 m_testCtx, "renderbuffer", "Tests for renderbuffer formats");
759 TestCaseGroup* const texRenderableTests = new TestCaseGroup(
760 m_testCtx, "texture", "Tests for texture formats");
762 static const struct AttPoint {
768 { GL_COLOR_ATTACHMENT0, "color0", "Tests for color attachments" },
769 { GL_STENCIL_ATTACHMENT, "stencil", "Tests for stencil attachments" },
770 { GL_DEPTH_ATTACHMENT, "depth", "Tests for depth attachments" },
773 // At each attachment point, iterate through all the possible formats to
774 // detect both false positives and false negatives.
775 const Formats rboFmts = m_maxFormats.getFormats(ANY_FORMAT);
776 const Formats texFmts = m_maxFormats.getFormats(ANY_FORMAT);
778 for (const AttPoint* it = DE_ARRAY_BEGIN(attPoints); it != DE_ARRAY_END(attPoints); it++)
780 TestCaseGroup* const rbAttTests = new TestCaseGroup(m_testCtx, it->name, it->desc);
781 TestCaseGroup* const texAttTests = new TestCaseGroup(m_testCtx, it->name, it->desc);
783 for (Formats::const_iterator it2 = rboFmts.begin(); it2 != rboFmts.end(); it2++)
785 const RenderableParams params = { it->attPoint, GL_RENDERBUFFER, *it2 };
786 rbAttTests->addChild(new RenderableTest(*this, params));
788 rbRenderableTests->addChild(rbAttTests);
790 for (Formats::const_iterator it2 = texFmts.begin(); it2 != texFmts.end(); it2++)
792 const RenderableParams params = { it->attPoint, GL_TEXTURE, *it2 };
793 texAttTests->addChild(new RenderableTest(*this, params));
795 texRenderableTests->addChild(texAttTests);
797 renderableTests->addChild(rbRenderableTests);
798 renderableTests->addChild(texRenderableTests);
800 return renderableTests;
803 TestCaseGroup* Context::createAttachmentTests (void)
805 TestCaseGroup* const attCombTests = new TestCaseGroup(
806 m_testCtx, "attachment_combinations", "Tests for attachment combinations");
808 static const GLenum s_bufTypes[] = { GL_NONE, GL_RENDERBUFFER, GL_TEXTURE };
809 static const Range<GLenum> s_kinds = GLS_ARRAY_RANGE(s_bufTypes);
811 for (const GLenum* col0 = s_kinds.begin(); col0 != s_kinds.end(); ++col0)
812 for (const GLenum* coln = s_kinds.begin(); coln != s_kinds.end(); ++coln)
813 for (const GLenum* dep = s_kinds.begin(); dep != s_kinds.end(); ++dep)
814 for (const GLenum* stc = s_kinds.begin(); stc != s_kinds.end(); ++stc)
816 AttachmentParams params = { *col0, *coln, *dep, *stc };
817 attCombTests->addChild(new AttachmentTest(*this, params));
823 TestCaseGroup* Context::createSizeTests (void)
825 TestCaseGroup* const sizeTests = new TestCaseGroup(
826 m_testCtx, "size", "Tests for attachment sizes");
827 sizeTests->addChild(new EmptyImageTest(
829 "Test for zero-sized image attachment"));
830 sizeTests->addChild(new DistinctSizeTest(
832 "Test for attachments with different sizes"));