From 720eba4c84ebd665ec6b1c40e7cd1d322d1b0d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Wed, 11 Feb 2015 15:19:33 +0200 Subject: [PATCH] mesa: fix OES_texture_float texture render target behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current implementation allowed usage of texture as a render target as this was 'expected behavior' by corresponding WebGL extension and is also allowed by the oes-texture-float WebGL test. However this broke ES3 conformance tests that do not accept such behavior. Patch sets such an fbo incomplete as expected by the ES3 conformance tests. Signed-off-by: Tapani Pälli Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88905 --- src/mesa/main/fbobject.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index dae9d4e..52d13e6 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -781,6 +781,16 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, att->Complete = GL_FALSE; return; } + /* OES_texture_float allows creation and use of floating point + * textures with GL_FLOAT, GL_HALF_FLOAT but it does not allow + * these textures to be used as a render target. + */ + if (_mesa_is_gles(ctx) && (texImage->TexObject->_IsFloat || + texImage->TexObject->_IsHalfFloat)) { + att_incomplete("bad internal format"); + att->Complete = GL_FALSE; + return; + } } else if (format == GL_DEPTH) { if (baseFormat == GL_DEPTH_COMPONENT) { -- 2.1.0