class ES2Checker : public Checker
{
public:
- ES2Checker (void) : m_width(-1), m_height(-1) {}
+ ES2Checker (const glu::RenderContext& ctx);
void check (GLenum attPoint, const Attachment& att,
const Image* image);
private:
GLsizei m_height; //< The common height of images
};
-void ES2Checker::check(GLenum attPoint, const Attachment& att, const Image* image)
+ES2Checker::ES2Checker (const glu::RenderContext& ctx)\
+ : Checker (ctx)
+ , m_width (-1)
+ , m_height (-1)
+{
+}
+
+void ES2Checker::check (GLenum attPoint, const Attachment& att, const Image* image)
{
DE_UNREF(attPoint);
DE_UNREF(att);
m_width = image->width;
m_height = image->height;
}
- else
+ else if (image->width != m_width || image->height != m_height)
{
- if (image->width != m_width || image->height != m_height)
+ // Since GLES3 is "backwards compatible" to GLES2, we might actually be running
+ // on a GLES3 context. On GLES3, FRAMEBUFFER_INCOMPLETE_DIMENSIONS is not generated
+ // if attachments have different sizes.
+ if (!gls::FboUtil::checkExtensionSupport(m_renderCtx, "DEQP_gles3_core_compatible"))
+ {
+ // running on GLES2
addFBOStatus(GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS, "Sizes of attachments differ");
+ }
}
// GLES2, 4.4.5: "some implementations may not support rendering to
// particular combinations of internal formats. If the combination of
return STOP;
}
-class ES2CheckerFactory : public CheckerFactory {
+class ES2CheckerFactory : public CheckerFactory
+{
public:
- Checker* createChecker (void) { return new ES2Checker(); }
+ Checker* createChecker (const glu::RenderContext& ctx) { return new ES2Checker(ctx); }
};
class TestGroup : public TestCaseGroup
class ES3Checker : public Checker
{
public:
- ES3Checker (void)
- : m_numSamples (-1)
+ ES3Checker (const glu::RenderContext& ctx)
+ : Checker (ctx)
+ , m_numSamples (-1)
, m_depthStencilImage (0)
, m_depthStencilType (GL_NONE) {}
void check (GLenum attPoint, const Attachment& att, const Image* image);
class ES3CheckerFactory : public CheckerFactory
{
public:
- Checker* createChecker (void) { return new ES3Checker(); }
+ Checker* createChecker (const glu::RenderContext& ctx) { return new ES3Checker(ctx); }
};
class TestGroup : public TestCaseGroup
CheckerFactory& factory)
: m_testCtx (testCtx)
, m_renderCtx (renderCtx)
- , m_verifier (m_ctxFormats, factory)
+ , m_verifier (m_ctxFormats, factory, renderCtx)
, m_haveMultiColorAtts (false)
{
FormatExtEntries extRange = GLS_ARRAY_RANGE(s_esExtFormats);
return (majorVersion > requiredMajor) || (majorVersion == requiredMajor && minorVersion >= requiredMinor);
}
-// Check support for GL_* and DEQP_* extensions
static bool checkExtensionSupport (const ContextInfo& ctxInfo, const RenderContext& ctx, const std::string& extension)
{
if (de::beginsWith(extension, "GL_"))
}
}
+bool checkExtensionSupport (const RenderContext& ctx, const std::string& extension)
+{
+ const de::UniquePtr<ContextInfo> info(ContextInfo::create(ctx));
+ return checkExtensionSupport(*info, ctx, extension);
+}
+
std::string getExtensionDescription (const std::string& extension)
{
if (de::beginsWith(extension, "GL_"))
using namespace config;
-Checker::Checker (void)
+Checker::Checker (const glu::RenderContext& ctx)
+ : m_renderCtx(ctx)
{
m_statusCodes.setAllowComplete(true);
}
m_statusCodes.addFBOErrorStatus(status, description);
}
-FboVerifier::FboVerifier (const FormatDB& formats, CheckerFactory& factory)
- : m_formats (formats)
- , m_factory (factory)
+FboVerifier::FboVerifier (const FormatDB& formats, CheckerFactory& factory, const glu::RenderContext& renderCtx)
+ : m_formats (formats)
+ , m_factory (factory)
+ , m_renderCtx (renderCtx)
{
}
ValidStatusCodes FboVerifier::validStatusCodes (const Framebuffer& fboConfig) const
{
const AttachmentMap& atts = fboConfig.attachments;
- const UniquePtr<Checker> cctx(m_factory.createChecker());
+ const UniquePtr<Checker> cctx(m_factory.createChecker(m_renderCtx));
for (TextureMap::const_iterator it = fboConfig.textures.begin();
it != fboConfig.textures.end(); it++)
typedef Range<FormatExtEntry> FormatExtEntries;
+// Check support for GL_* and DEQP_* extensions
+bool checkExtensionSupport (const glu::RenderContext& ctx, const std::string& extension);
+
// Accepts GL_* and DEQP_* extension strings and converts DEQP_* strings to a human readable string
std::string getExtensionDescription (const std::string& extensionName);
class Checker
{
public:
- Checker (void);
- virtual ~Checker (void) {}
+ Checker (const glu::RenderContext&);
+ virtual ~Checker (void) {}
- void addGLError (glw::GLenum error, const char* description);
- void addPotentialGLError (glw::GLenum error, const char* description);
- void addFBOStatus (glw::GLenum status, const char* description);
- void addPotentialFBOStatus (glw::GLenum status, const char* description);
+ void addGLError (glw::GLenum error, const char* description);
+ void addPotentialGLError (glw::GLenum error, const char* description);
+ void addFBOStatus (glw::GLenum status, const char* description);
+ void addPotentialFBOStatus (glw::GLenum status, const char* description);
- ValidStatusCodes getStatusCodes (void) { return m_statusCodes; }
+ ValidStatusCodes getStatusCodes (void) { return m_statusCodes; }
- virtual void check (glw::GLenum attPoint,
- const config::Attachment& att,
- const config::Image* image) = 0;
-private:
+ virtual void check (glw::GLenum attPoint,
+ const config::Attachment& att,
+ const config::Image* image) = 0;
- ValidStatusCodes m_statusCodes; //< Allowed return values for glCheckFramebufferStatus.
+protected:
+ const glu::RenderContext& m_renderCtx;
+
+private:
+ ValidStatusCodes m_statusCodes; //< Allowed return values for glCheckFramebufferStatus.
};
class CheckerFactory
{
public:
- virtual Checker* createChecker (void) = 0;
+ virtual Checker* createChecker (const glu::RenderContext&) = 0;
};
typedef std::set<glw::GLenum> AttachmentPoints;
class FboVerifier
{
public:
- FboVerifier (const FormatDB& formats,
- CheckerFactory& factory);
+ FboVerifier (const FormatDB& formats,
+ CheckerFactory& factory,
+ const glu::RenderContext& renderCtx);
ValidStatusCodes validStatusCodes (const config::Framebuffer& cfg) const;
private:
const FormatDB& m_formats;
CheckerFactory& m_factory;
+ const glu::RenderContext& m_renderCtx;
};
} // FboUtil