Bug 103227 - [G965 G45 ILK] ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float regression
Summary: [G965 G45 ILK] ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float regr...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Tapani Pälli
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords: bisected, regression
Depends on:
Blocks: mesa-17.3
  Show dependency treegraph
 
Reported: 2017-10-11 17:08 UTC by Mark Janes
Modified: 2017-11-28 06:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Hack that makes the test pass (637 bytes, patch)
2017-11-16 08:59 UTC, Kenneth Graunke
Details | Splinter Review
hopeful fix (2.38 KB, patch)
2017-11-20 13:02 UTC, Tapani Pälli
Details | Splinter Review

Description Mark Janes 2017-10-11 17:08:46 UTC
g33
ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float

g45, g965
ES2-CTS.functional.fbo.completeness.renderable.texture.color0.r16f
ES2-CTS.functional.fbo.completeness.renderable.texture.color0.rg16f
ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float

bisected to:
c16a7443e9999a80bc1e87134297f96f1216d702
Author:     Eric Anholt <eric@anholt.net>
mesa: Expose GL_OES_required_internalformat on GLES contexts.

The same patch fixed several tests on the same platform.  It's possible that this bug should be marked WONTFIX

Sample output:
---------------------------------------------------------------
ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float

GTFExtensionTestTextureFloat::Apply/error: glTexSubImage2D: GL_INVALID_OPERATION error when passing GL_FLOAT as type.
GTFExtensionTestTextureFloat::Apply/error: Output image does not match reference image. Writing diff.
GTFRunTest: FAIL
0 passes, 1 failures, test case FAILED!
---------------------------------------------------------------
ES2-CTS.functional.fbo.completeness.renderable.texture.color0.rg16f

Type: GL_TEXTURE_2D
Internal format: GL_RG16F
Width: 64
Height: 64
Levels: 1
Target: GL_FRAMEBUFFER
Type: GL_TEXTURE
Image Name: 98
Mipmap Level: 0
Texture Target: GL_TEXTURE_2D
* Unsupported texture format
	* requires any of the extensions or combinations:
		- GLES3 compatible context

* Unsupported renderbuffer format
	* requires any of the extensions or combinations:
		- GLES3 compatible context and GL_EXT_color_buffer_float
		- GL_EXT_color_buffer_half_float and GL_OES_texture_half_float

* Format is NOT color-renderable
	* extensions that would make format color-renderable:
		- GLES3 compatible context and GL_EXT_color_buffer_float
		- GL_EXT_color_buffer_half_float and GL_OES_texture_half_float

* Format is NOT depth-renderable
	* no extension can make this format depth-renderable
* Format is NOT stencil-renderable
	* no extension can make this format stencil-renderable
Rules:
	 * Format GL_RG16F does not exist

Rules:
	 * Format GL_RG16F does not exist

Rules:
	 * Format GL_RG16F does not exist

Rules:
	 * Attachment format is not legal

Rules:
	 * Particular format combinations need not to be supported

Expected one of GL_INVALID_ENUM (during FBO initialization), GL_INVALID_OPERATION (during FBO initialization), GL_INVALID_VALUE (during FBO initialization), GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT or GL_FRAMEBUFFER_UNSUPPORTED.
Received GL_FRAMEBUFFER_COMPLETE.
Comment 1 Eric Anholt 2017-10-11 17:48:30 UTC
Pushed a patch to jenkins that fixes the error on VK-GL-CTS

MESA_GLES_VERSION_OVERRIDE=2.0 ./deqp-gles2 -n dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rg16f

Let's see how it goes.
Comment 2 Mark Janes 2017-10-12 20:48:59 UTC
I verified this patch to fix:

g33
ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float

g45, g965, ilk
ES2-CTS.functional.fbo.completeness.renderable.texture.color0.r16f
ES2-CTS.functional.fbo.completeness.renderable.texture.color0.rg16f
Comment 3 Mark Janes 2017-10-13 16:52:20 UTC
This bug is partially fixed by 376a0a9b08543f3978efd6f51cec3d4cf628e939
Author:     Eric Anholt <eric@anholt.net>
mesa: Disallow GL_RED/GL_RG with half-floats on GLES2.


Remaining regressions on g45, g965, ilk:
ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float

Standard Output
GTFExtensionTestTextureFloat::Apply/error: glTexSubImage2D: GL_INVALID_OPERATION error when passing GL_FLOAT as type.
GTFExtensionTestTextureFloat::Apply/error: Output image does not match reference image. Writing diff.
GTFRunTest: FAIL
0 passes, 1 failures, test case FAILED!
Comment 4 Matt Turner 2017-11-14 19:09:02 UTC
If I understand correctly, the only remaining failure is on G965/G45 and is ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float
Comment 5 Mark Janes 2017-11-15 16:57:09 UTC
The test also fails on ILK.
Comment 6 Kenneth Graunke 2017-11-16 08:59:50 UTC
Created attachment 135513 [details] [review]
Hack that makes the test pass

So, ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float is failing because of an INVALID_OPERATION error that Eric's commit c16a7443e9999a80bc1e87134297f96f1216d702 begins raising in ES 2.0 contexts (but not ES 3.0+).  The bug only shows up on Gen4-5 because those only do 2.0, not 3.0.

Mesa: User error: GL_INVALID_OPERATION in glTexSubImage2D(format = GL_RGB, type = GL_FLOAT, internalformat = GL_RGB32F)
#+ glTexSubImage2D: GL_INVALID_OPERATION error when passing GL_FLOAT as type.

Here's a hack that comments out the INVALID_OPERATION, and makes the test pass.  I have no idea if it actually should be legal or not...
Comment 7 Tapani Pälli 2017-11-20 12:42:27 UTC
When the first texture upload happens via glTexImage2D we 'adjust' the internal format since GLES <= 2.0 does not have sized formats specified. This could be what is causing the issues here since we might set GL_RGB16F and GL_RGB32F as internalformat there.

So taking that in to account ... it looks like glTexSubImage2D error checking is a bit broken. It uses texture_format_error_check_gles() which has been originally written for glTexImage() family of functions so the internalFormat checks there don't make sense 'as is' for floating point textures. I will attempt to write a fix based on these assumptions.
Comment 8 Tapani Pälli 2017-11-20 13:02:31 UTC
Created attachment 135602 [details] [review]
hopeful fix

This should fix the issue, will run tests.
Comment 9 Tapani Pälli 2017-11-21 05:29:27 UTC
Mark, should I see 'expected failure but passed' in CI or do we still run these tests?
Comment 10 Mark Janes 2017-11-21 16:12:00 UTC
because these regressions are on very slow targets, they only run with the "daily" CI builds.
Comment 11 Mark Janes 2017-11-21 23:08:59 UTC
I have verified in the CI that Tapani's commit fixes the tests.  You can put my Tested-By on the commit.
Comment 12 Tapani Pälli 2017-11-23 05:55:30 UTC
pending code review
Comment 13 Tapani Pälli 2017-11-28 06:59:24 UTC
commit 1e508e10d9ae649bfe5ab7b1842993be50052b21
Author: Tapani Pälli <tapani.palli@intel.com>
Date:   Mon Nov 20 15:00:19 2017 +0200

    mesa/gles: adjust internal format in glTexSubImage2D error checks
    
    When floating point textures are created on OpenGL ES 2.0, driver
    is free to choose used internal format. Mesa makes this decision in
    adjust_for_oes_float_texture. Error checking for glTexImage2D properly
    checks that sized formats are not used. We use same error checking
    path for glTexSubImage2D (since there is lot of overlap), however since
    those checks include internalFormat checks, we need to pass original
    internalFormat passed by the client. Patch adds oes_float_internal_format
    that does reverse adjust_for_oes_float_texture to get that format.
    
    Fixes following test failure:
       ES2-CTS.gtf.GL2ExtensionTests.texture_float.texture_float
    
    (when running test with MESA_GLES_VERSION_OVERRIDE=2.0)
    
    Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103227
    Cc: "17.3" <mesa-stable@lists.freedesktop.org>
    Reviewed-by: Matt Turner <mattst88@gmail.com>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.