Bug 88905

Summary: [SNB+ Bisected]Ogles3conform ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels fails
Product: Mesa Reporter: lu hua <huax.lu>
Component: Drivers/DRI/i965Assignee: Tapani Pälli <lemody>
Status: VERIFIED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: high CC: kevin.rogovin
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: workaround
workaround
fix

Description lu hua 2015-02-02 02:34:26 UTC
System Environment:
--------------------------
Platform: HSW
Libdrm:		(master)libdrm-2.4.59-6-g28ee135a37e10b9a6cd62d67df0332e38ee0b85c
Mesa:		(master)6094619c0297180db218e5b4e45fc07aff116413
Xserver:	(master)xorg-server-1.16.99.902-4-g697b696e5e24d0679f133183a3bb0852025377c2
Xf86_video_intel:(master)2.99.917-75-g6d2754b1902e8bce37818c854fb890400b27343e
Libva:		(master)f9741725839ea144e9a6a1827f74503ee39946c3
Libva_intel_driver:(master)bf324e3440246a487997a1624ac862e3e4027f9e
Kernel:   (drm-intel-nightly)8b4216f91c7bf8d3459cadf9480116220bd6545e

Bug detailed description:
---------------------------
It fails on SNB+ platforms with mesa master branch, works well on 10.4 branch.
Following cases also fail with the same bisect commit
ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels_pbo
ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels_pixelstore

Bisect shows:e638841b87a5d9454739195b49c403ca9a22a59e is the first bad commit
commit e638841b87a5d9454739195b49c403ca9a22a59e
Author:     Kalyan Kondapally <kondapallykalyancontribute@gmail.com>
AuthorDate: Wed Jan 7 20:30:27 2015 -0800
Commit:     Tapani Pälli <tapani.palli@intel.com>
CommitDate: Thu Jan 29 08:22:12 2015 +0200

    Mesa: Advertise GL_OES_texture_*float* extensions support with i965.

    This patch advertises support for GL_OES_texture_*float* extensions
    when using i965 drivers.

    Signed-off-by: Kevin Rogovin <kevin.rogovin@intel.com>
    Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
    Reviewed-by: Tapani Pälli <tapani.palli@intel.com>

output:
dEQP Core GL-CTS-2.0 (0x0052484b) starting..
  target implementation = 'X11'

Test case 'ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels'..
ERROR:packed_pixels:DoRead: FBO is complete but expected incomplete with sizedFormat GL_RGBA, attachemnt GL_COLOR_ATTACHMENT0
INFO:packed_pixels:countReadPixels: 8821, countReadPixelsOK: 47
INFO:packed_pixels:countCompare: 47, countCompareOK: 47
  Fail (Fail)

DONE!

Test run totals:
  Passed:        0/1 (0.00%)
  Failed:        1/1 (100.00%)
  Not supported: 0/1 (0.00%)
  Warnings:      0/1 (0.00%)

Reproduce steps:
-------------------------
1. xinit
2. ./glcts --deqp-case=ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels
Comment 1 Tapani Pälli 2015-02-06 06:13:17 UTC
There seems to be issues with texture upload when type is GL_FLOAT and format is GL_LUMINANCE, GL_ALPHA or GL_LUMINANCE_ALPHA.
Comment 2 Tapani Pälli 2015-02-06 09:06:01 UTC
(In reply to Tapani Pälli from comment #1)
> There seems to be issues with texture upload when type is GL_FLOAT and
> format is GL_LUMINANCE, GL_ALPHA or GL_LUMINANCE_ALPHA.

urgh unfortunately the problem is bigger than this, plan was to expose this for only ES2 but it seems ES3 also now uses it, this is not taken account in mesa_es3_error_check_format_and_type and perhaps some other places .. will dig deeper.
Comment 3 Tapani Pälli 2015-02-06 09:35:03 UTC
(In reply to Tapani Pälli from comment #2)
> (In reply to Tapani Pälli from comment #1)
> > There seems to be issues with texture upload when type is GL_FLOAT and
> > format is GL_LUMINANCE, GL_ALPHA or GL_LUMINANCE_ALPHA.
> 
> urgh unfortunately the problem is bigger than this, plan was to expose this
> for only ES2 but it seems ES3 also now uses it, this is not taken account in
> mesa_es3_error_check_format_and_type and perhaps some other places .. will
> dig deeper.

To be clear, I mean that some of the added half-float support seems to be enabling/executed also for ES3 which makes test fail.
Comment 4 Tapani Pälli 2015-02-06 09:46:24 UTC
(In reply to Tapani Pälli from comment #3)
> (In reply to Tapani Pälli from comment #2)
> > (In reply to Tapani Pälli from comment #1)
> > > There seems to be issues with texture upload when type is GL_FLOAT and
> > > format is GL_LUMINANCE, GL_ALPHA or GL_LUMINANCE_ALPHA.
> > 
> > urgh unfortunately the problem is bigger than this, plan was to expose this
> > for only ES2 but it seems ES3 also now uses it, this is not taken account in
> > mesa_es3_error_check_format_and_type and perhaps some other places .. will
> > dig deeper.
> 
> To be clear, I mean that some of the added half-float support seems to be
> enabling/executed also for ES3 which makes test fail.

And unfortunately the added float support too :/ I will investigate how to make this specific for gles2.
Comment 5 Tapani Pälli 2015-02-07 21:19:38 UTC
Created attachment 113254 [details] [review]
workaround

Here's a first workaround that makes the test pass. I will need to get more familiar with the texture and renderbuffer validation code to understand why this validation does not already happen.
Comment 6 Tapani Pälli 2015-02-08 07:12:41 UTC
Created attachment 113258 [details] [review]
workaround

workaround, real fix will be to correct validation code
Comment 7 lu hua 2015-02-11 03:22:16 UTC
(In reply to Tapani Pälli from comment #6)
> Created attachment 113258 [details] [review] [review]
> workaround
> 
> workaround, real fix will be to correct validation code

Fixed by this patch.
dEQP Core GL-CTS-2.0 (0x0052484b) starting..
  target implementation = 'X11'

Test case 'ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels'..
INFO:packed_pixels:countReadPixels: 8821, countReadPixelsOK: 47
INFO:packed_pixels:countCompare: 47, countCompareOK: 47
  Pass (Pass)

DONE!

Test run totals:
  Passed:        1/1 (100.00%)
  Failed:        0/1 (0.00%)
  Not supported: 0/1 (0.00%)
  Warnings:      0/1 (0.00%)
Comment 8 Tapani Pälli 2015-02-11 13:09:20 UTC
Now I understand the problem. OES_texture_float does not specify floating point render target support. Our implementation has this because it is 'expected' by the corresponding WebGL extension. Related discussion in the khronos public bugzilla:

https://www.khronos.org/bugzilla/show_bug.cgi?id=729

There's also bunch of bugs in the internal bugzilla. WebGL extension specification mentions that new implementation should not implement render target support but implement WEBGL_color_buffer_float which maps with  EXT_color_buffer_half_float:

https://www.khronos.org/registry/webgl/extensions/OES_texture_float/

So, to put it short our implementation is wrong in allowing render targets to be created with GL_FLOAT and GL_HALF_FLOAT. Unfortunately fixing this means that we will loose some nice deferred rendering webgl demos enabled by current implementation, we could think of having override to allow this later (?) Will investigate a proper fix.
Comment 9 Tapani Pälli 2015-02-12 07:34:23 UTC
Created attachment 113391 [details] [review]
fix

set fbo incomplete if GL_FLOAT or GL_HALF_FLOAT is set as internalformat.
Comment 10 Tapani Pälli 2015-02-12 12:36:53 UTC
Lu Hua, could you run full suite with the patch to see any possible regressions?
Comment 11 Tapani Pälli 2015-02-13 06:41:46 UTC
fix pushed
Comment 12 lu hua 2015-02-13 07:08:56 UTC
(In reply to Tapani Pälli from comment #10)
> Lu Hua, could you run full suite with the patch to see any possible
> regressions?

Test full ogles3conform, this issue  is fixed by this patch and no new regression.
                                                           master   master with patch
ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels           fail           pass
ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels_pbo       fail           pass
ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels_pixelstore fail           pass
Comment 13 Tapani Pälli 2015-02-13 07:13:14 UTC
(In reply to lu hua from comment #12)
> (In reply to Tapani Pälli from comment #10)
> > Lu Hua, could you run full suite with the patch to see any possible
> > regressions?
> 
> Test full ogles3conform, this issue  is fixed by this patch and no new
> regression.
>                                                            master   master
> with patch
> ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels           fail          
> pass
> ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels_pbo       fail          
> pass
> ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels_pixelstore fail          
> pass

Nice, thanks for testing round!
Comment 14 lu hua 2015-02-15 02:49:34 UTC
Verified.Fixed.

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.