<Test name="tex_rgb8_tex_subimage_rgb8">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="tex_rgb8_tex_subimage_rgb565">
- <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
- </Test>
<Test name="tex_rgb8_renderbuffer_clear_color">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
<Test name="tex_rgba8_tex_subimage_rgba8">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="tex_rgba8_tex_subimage_rgba5_a1">
- <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
- </Test>
- <Test name="tex_rgba8_tex_subimage_rgba4">
- <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
- </Test>
<Test name="tex_rgba8_renderbuffer_clear_color">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
<Test name="tex_rgba5_a1_tex_subimage_rgba5_a1">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="tex_rgba5_a1_tex_subimage_rgba4">
- <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
- </Test>
<Test name="tex_rgba5_a1_renderbuffer_clear_color">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
<Test name="tex_rgba4_tex_subimage_rgba8">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="tex_rgba4_tex_subimage_rgba5_a1">
- <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
- </Test>
<Test name="tex_rgba4_tex_subimage_rgba4">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
<Test name="renderbuffer_rgba4_tex_subimage_rgba8">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="renderbuffer_rgba4_tex_subimage_rgba5_a1">
- <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
- </Test>
<Test name="renderbuffer_rgba4_tex_subimage_rgba4">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
<Test name="renderbuffer_rgb5_a1_tex_subimage_rgba5_a1">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
- <Test name="renderbuffer_rgb5_a1_tex_subimage_rgba4">
- <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
- </Test>
<Test name="renderbuffer_rgb5_a1_renderbuffer_clear_color">
<TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
</Test>
dEQP-EGL.functional.image.create.gles2_renderbuffer_depth16_depth_buffer
dEQP-EGL.functional.image.create.gles2_renderbuffer_stencil_stencil_buffer
dEQP-EGL.functional.image.modify.tex_rgb8_tex_subimage_rgb8
-dEQP-EGL.functional.image.modify.tex_rgb8_tex_subimage_rgb565
dEQP-EGL.functional.image.modify.tex_rgb8_renderbuffer_clear_color
dEQP-EGL.functional.image.modify.tex_rgb565_tex_subimage_rgb8
dEQP-EGL.functional.image.modify.tex_rgb565_tex_subimage_rgb565
dEQP-EGL.functional.image.modify.tex_rgb565_renderbuffer_clear_color
dEQP-EGL.functional.image.modify.tex_rgba8_tex_subimage_rgba8
-dEQP-EGL.functional.image.modify.tex_rgba8_tex_subimage_rgba5_a1
-dEQP-EGL.functional.image.modify.tex_rgba8_tex_subimage_rgba4
dEQP-EGL.functional.image.modify.tex_rgba8_renderbuffer_clear_color
dEQP-EGL.functional.image.modify.tex_rgba5_a1_tex_subimage_rgba8
dEQP-EGL.functional.image.modify.tex_rgba5_a1_tex_subimage_rgba5_a1
-dEQP-EGL.functional.image.modify.tex_rgba5_a1_tex_subimage_rgba4
dEQP-EGL.functional.image.modify.tex_rgba5_a1_renderbuffer_clear_color
dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba8
-dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba5_a1
dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba4
dEQP-EGL.functional.image.modify.tex_rgba4_renderbuffer_clear_color
dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba8
-dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba5_a1
dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba4
dEQP-EGL.functional.image.modify.renderbuffer_rgba4_renderbuffer_clear_color
dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_tex_subimage_rgba8
dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_tex_subimage_rgba5_a1
-dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_tex_subimage_rgba4
dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_renderbuffer_clear_color
dEQP-EGL.functional.image.modify.renderbuffer_rgb565_tex_subimage_rgb8
dEQP-EGL.functional.image.modify.renderbuffer_rgb565_tex_subimage_rgb565
MovePtr<ClientBuffer> createBuffer (const glw::Functions&, Texture2D*) const;
string getRequiredExtension (void) const { return "EGL_ANDROID_image_native_buffer"; }
EGLImageKHR createImage (const Library& egl, EGLDisplay dpy, EGLContext ctx, EGLClientBuffer clientBuffer) const;
- GLenum getFormat (void) const { return m_format; }
+ GLenum getEffectiveFormat (void) const { return m_format; }
protected:
GLenum m_format;
Create (MovePtr<ImageSource> imgSource) : m_imgSource(imgSource) {}
string getRequiredExtension (void) const { return m_imgSource->getRequiredExtension(); }
bool invokeGLES2 (GLES2ImageApi& api, MovePtr<UniqueImage>& image, tcu::Texture2D& ref) const;
- glw::GLenum getFormat (void) const { return m_imgSource->getFormat(); }
+ glw::GLenum getEffectiveFormat (void) const { return m_imgSource->getEffectiveFormat(); }
private:
UniquePtr<ImageSource> m_imgSource;
ModifyTexSubImage (GLenum format, GLenum type) : m_format(format), m_type(type) {}
bool invokeGLES2 (GLES2ImageApi& api, MovePtr<UniqueImage>& image, tcu::Texture2D& ref) const;
GLenum getFormat (void) const { return m_format; }
+ GLenum getType (void) const { return m_type; }
private:
GLenum m_format;
{
if (const GLES2ImageApi::Create* gles2Create = dynamic_cast<const GLES2ImageApi::Create*>(&create))
{
- const GLenum createFormat = gles2Create->getFormat();
+ const GLenum createFormat = gles2Create->getEffectiveFormat();
if (dynamic_cast<const GLES2ImageApi::RenderTexture2D*>(&render))
{
return new SimpleCreationTests(eglTestCtx, name, desc);
}
-bool isCompatibleFormats (GLenum createFormat, GLenum modifyFormat)
+bool isCompatibleFormats (GLenum createFormat, GLenum modifyFormat, GLenum modifyType)
{
- switch (createFormat)
+ switch (modifyFormat)
{
case GL_RGB:
- case GL_RGB8:
- case GL_RGB565:
- if (modifyFormat == GL_RGB
- || modifyFormat == GL_RGB8
- || modifyFormat == GL_RGB565)
- return true;
- else
- return false;
+ switch (modifyType)
+ {
+ case GL_UNSIGNED_BYTE:
+ return createFormat == GL_RGB
+ || createFormat == GL_RGB8
+ || createFormat == GL_RGB565
+ || createFormat == GL_SRGB8;
+
+ case GL_BYTE:
+ return createFormat == GL_RGB8_SNORM;
+
+ case GL_UNSIGNED_SHORT_5_6_5:
+ return createFormat == GL_RGB
+ || createFormat == GL_RGB565;
+
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ return createFormat == GL_R11F_G11F_B10F;
+
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
+ return createFormat == GL_RGB9_E5;
+
+ case GL_HALF_FLOAT:
+ return createFormat == GL_RGB16F
+ || createFormat == GL_R11F_G11F_B10F
+ || createFormat == GL_RGB9_E5;
+
+ case GL_FLOAT:
+ return createFormat == GL_RGB16F
+ || createFormat == GL_RGB32F
+ || createFormat == GL_R11F_G11F_B10F
+ || createFormat == GL_RGB9_E5;
+
+ default:
+ DE_FATAL("Unknown modify type");
+ return false;
+ }
case GL_RGBA:
- case GL_RGBA4:
- case GL_RGBA8:
- case GL_RGB5_A1:
- if (modifyFormat == GL_RGBA
- || modifyFormat == GL_RGBA8
- || modifyFormat == GL_RGBA4
- || modifyFormat == GL_RGB5_A1)
- return true;
- else
- return false;
+ switch (modifyType)
+ {
+ case GL_UNSIGNED_BYTE:
+ return createFormat == GL_RGBA8
+ || createFormat == GL_RGB5_A1
+ || createFormat == GL_RGBA4
+ || createFormat == GL_SRGB8_ALPHA8
+ || createFormat == GL_RGBA;
- case GL_DEPTH_COMPONENT16:
- case GL_STENCIL_INDEX8:
- return false;
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ return createFormat == GL_RGBA4
+ || createFormat == GL_RGBA;
+
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ return createFormat == GL_RGB5_A1
+ || createFormat == GL_RGBA;
+
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ return createFormat == GL_RGB10_A2
+ || createFormat == GL_RGB5_A1;
+
+ case GL_HALF_FLOAT:
+ return createFormat == GL_RGBA16F;
+
+ case GL_FLOAT:
+ return createFormat == GL_RGBA16F
+ || createFormat == GL_RGBA32F;
+
+ default:
+ DE_FATAL("Unknown modify type");
+ return false;
+ };
default:
- DE_ASSERT(false);
+ DE_FATAL("Unknown modify format");
return false;
}
}
{
if (const GLES2ImageApi::Create* gles2Create = dynamic_cast<const GLES2ImageApi::Create*>(&create))
{
- const GLenum createFormat = gles2Create->getFormat();
+ const GLenum createFormat = gles2Create->getEffectiveFormat();
if (const GLES2ImageApi::ModifyTexSubImage* gles2TexSubImageModify = dynamic_cast<const GLES2ImageApi::ModifyTexSubImage*>(&modify))
{
- const GLenum modifyFormat = gles2TexSubImageModify->getFormat();
+ const GLenum modifyFormat = gles2TexSubImageModify->getFormat();
+ const GLenum modifyType = gles2TexSubImageModify->getType();
- return isCompatibleFormats(createFormat, modifyFormat);
+ return isCompatibleFormats(createFormat, modifyFormat, modifyType);
}
if (dynamic_cast<const GLES2ImageApi::ModifyRenderbufferClearColor*>(&modify))
public:
TextureImageSource (GLenum internalFormat, GLenum format, GLenum type, bool useTexLevel0) : m_internalFormat(internalFormat), m_format(format), m_type(type), m_useTexLevel0(useTexLevel0) {}
MovePtr<ClientBuffer> createBuffer (const glw::Functions& gl, Texture2D* reference) const;
- GLenum getFormat (void) const { return m_format; }
+ GLenum getEffectiveFormat (void) const;
GLenum getInternalFormat (void) const { return m_internalFormat; }
protected:
const bool m_useTexLevel0;
};
+bool isSizedFormat (GLenum format)
+{
+ try
+ {
+ glu::mapGLInternalFormat(format);
+ return true;
+ }
+ catch (const tcu::InternalError&)
+ {
+ return false;
+ }
+}
+
+GLenum getEffectiveFormat (GLenum format, GLenum type)
+{
+ return glu::getInternalFormat(glu::mapGLTransferFormat(format, type));
+}
+
+GLenum TextureImageSource::getEffectiveFormat (void) const
+{
+ if (isSizedFormat(m_internalFormat))
+ return m_internalFormat;
+ else
+ return deqp::egl::Image::getEffectiveFormat(m_format, m_type);
+}
+
AttribMap TextureImageSource::getCreateAttribs (void) const
{
AttribMap ret;
string getRequiredExtension (void) const { return "EGL_KHR_gl_renderbuffer_image"; }
MovePtr<ClientBuffer> createBuffer (const glw::Functions& gl, Texture2D* reference) const;
- GLenum getFormat (void) const { return m_format; }
+ GLenum getEffectiveFormat (void) const { return m_format; }
protected:
EGLenum getSource (void) const { return EGL_GL_RENDERBUFFER_KHR; }
string getRequiredExtension (void) const { fail(); return ""; }
MovePtr<ClientBuffer> createBuffer (const glw::Functions&, tcu::Texture2D*) const { fail(); return de::MovePtr<ClientBuffer>(); }
EGLImageKHR createImage (const Library& egl, EGLDisplay dpy, EGLContext ctx, EGLClientBuffer clientBuffer) const;
- GLenum getFormat (void) const { return m_format; }
+ GLenum getEffectiveFormat (void) const { return m_format; }
private:
const string m_message;
virtual std::string getRequiredExtension(void) const = 0;
virtual de::MovePtr<ClientBuffer> createBuffer (const glw::Functions& gl, tcu::Texture2D* reference = DE_NULL) const = 0;
virtual eglw::EGLImageKHR createImage (const eglw::Library& egl, eglw::EGLDisplay dpy, eglw::EGLContext ctx, eglw::EGLClientBuffer clientBuffer) const = 0;
- virtual glw::GLenum getFormat (void) const = 0;
+ virtual glw::GLenum getEffectiveFormat (void) const = 0;
};
de::MovePtr<ImageSource> createTextureImageSource (eglw::EGLenum source, glw::GLenum internalFormat, glw::GLenum format, glw::GLenum type, bool useTexLevel0 = false);