class ES2Checker : public Checker
{
public:
- ES2Checker (const glu::RenderContext& ctx);
+ ES2Checker (const glu::RenderContext& ctx, const FormatDB& formats);
void check (GLenum attPoint, const Attachment& att,
const Image* image);
private:
GLsizei m_height; //< The common height of images
};
-ES2Checker::ES2Checker (const glu::RenderContext& ctx)\
- : Checker (ctx)
+ES2Checker::ES2Checker (const glu::RenderContext& ctx, const FormatDB& formats)\
+ : Checker (ctx, formats)
, m_width (-1)
, m_height (-1)
{
class ES2CheckerFactory : public CheckerFactory
{
public:
- Checker* createChecker (const glu::RenderContext& ctx) { return new ES2Checker(ctx); }
+ Checker* createChecker (const glu::RenderContext& ctx, const FormatDB& formats) { return new ES2Checker(ctx, formats); }
};
class TestGroup : public TestCaseGroup
class ES3Checker : public Checker
{
public:
- ES3Checker (const glu::RenderContext& ctx)
- : Checker (ctx)
+ ES3Checker (const glu::RenderContext& ctx, const FormatDB& formats)
+ : Checker (ctx, formats)
, m_ctxInfo (glu::ContextInfo::create(ctx))
, m_numSamples (-1)
, m_depthStencilImage (0)
//! The common image for depth and stencil attachments.
GLuint m_depthStencilImage;
GLenum m_depthStencilType;
+ ImageFormat m_depthStencilFormat;
};
void ES3Checker::check (GLenum attPoint, const Attachment& att, const Image* image)
addPotentialFBOStatus(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE, "Number of samples differ");
}
- // "Depth and stencil attachments, if present, are the same image."
- if (!m_ctxInfo->isExtensionSupported("GL_EXT_separate_depth_stencil")
- && (attPoint == GL_DEPTH_ATTACHMENT || attPoint == GL_STENCIL_ATTACHMENT))
+ if (attPoint == GL_DEPTH_ATTACHMENT || attPoint == GL_STENCIL_ATTACHMENT)
{
if (m_depthStencilImage == 0)
{
m_depthStencilImage = att.imageName;
m_depthStencilType = attachmentType(att);
+ m_depthStencilFormat = image->internalFormat;
}
- else
+ else if (m_depthStencilImage != att.imageName || m_depthStencilType != attachmentType(att))
{
- if (m_depthStencilImage != att.imageName || m_depthStencilType != attachmentType(att))
+ // "Depth and stencil attachments, if present, are the same image."
+ if (!m_ctxInfo->isExtensionSupported("GL_EXT_separate_depth_stencil"))
addFBOStatus(GL_FRAMEBUFFER_UNSUPPORTED, "Depth and stencil attachments are not the same image");
+
+ // "The combination of internal formats of the attached images does not violate
+ // an implementation-dependent set of restrictions."
+ ImageFormat depthFormat = attPoint == GL_DEPTH_ATTACHMENT ? image->internalFormat : m_depthStencilFormat;
+ ImageFormat stencilFormat = attPoint == GL_STENCIL_ATTACHMENT ? image->internalFormat : m_depthStencilFormat;
+ if (m_formats.getFormatInfo(depthFormat) & STENCIL_RENDERABLE)
+ addPotentialFBOStatus(GL_FRAMEBUFFER_UNSUPPORTED, "Separate depth attachment has combined depth and stencil format");
+ if (m_formats.getFormatInfo(stencilFormat) & DEPTH_RENDERABLE)
+ addPotentialFBOStatus(GL_FRAMEBUFFER_UNSUPPORTED, "Separate stencil attachment has combined depth and stencil format");
}
}
}
class ES3CheckerFactory : public CheckerFactory
{
public:
- Checker* createChecker (const glu::RenderContext& ctx) { return new ES3Checker(ctx); }
+ Checker* createChecker (const glu::RenderContext& ctx, const FormatDB& formats) { return new ES3Checker(ctx, formats); }
};
class TestGroup : public TestCaseGroup
using namespace config;
-Checker::Checker (const glu::RenderContext& ctx)
- : m_renderCtx(ctx)
+Checker::Checker (const glu::RenderContext& ctx, const FormatDB& formats)
+ : m_renderCtx(ctx), m_formats(formats)
{
m_statusCodes.setAllowComplete(true);
}
ValidStatusCodes FboVerifier::validStatusCodes (const Framebuffer& fboConfig) const
{
const AttachmentMap& atts = fboConfig.attachments;
- const UniquePtr<Checker> cctx(m_factory.createChecker(m_renderCtx));
+ const UniquePtr<Checker> cctx(m_factory.createChecker(m_renderCtx, m_formats));
for (TextureMap::const_iterator it = fboConfig.textures.begin();
it != fboConfig.textures.end(); it++)
class Checker
{
public:
- Checker (const glu::RenderContext&);
+ Checker (const glu::RenderContext&, const FormatDB&);
virtual ~Checker (void) {}
void addGLError (glw::GLenum error, const char* description);
protected:
const glu::RenderContext& m_renderCtx;
+ const FormatDB& m_formats;
private:
ValidStatusCodes m_statusCodes; //< Allowed return values for glCheckFramebufferStatus.
class CheckerFactory
{
public:
- virtual Checker* createChecker (const glu::RenderContext&) = 0;
+ virtual Checker* createChecker (const glu::RenderContext&, const FormatDB&) = 0;
};
typedef std::set<glw::GLenum> AttachmentPoints;