Bug 107832

Summary: Gallium picking A16L16 formats when emulating INTENSITY16 conflicts with mesa
Product: Mesa Reporter: Gert Wollny <gw.fossdev>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Gert Wollny 2018-09-05 08:29:01 UTC
The piglit 

  ext_framebuffer_multisample-fast-clear GL_ARB_texture_float 

fails with an assertion raised if the GL_INTENSITY16F texture format is emulated by PIPE_FORMAT_L16A16_FLOAT that is actually picked by Gallium if no relevant intensity format is available. 

The problem is that in this case 

   glGetTexLevelParameteriv(..., GL_TEXTURE_INTENSITY_SIZE, ...)  

will return a zero component size because the texture info us read from the used replacement format that specifies that the intensity component size is 0, and as a fallback only RG is expected.
Comment 1 Juan A. Suarez 2018-09-21 10:31:43 UTC
A patch to fix this landed in upstream:

commit 47e01e77d8b658606527f048cda786440f7fbe85
Author: Gert Wollny <gert.wollny@collabora.com>
Date:   Mon Sep 10 12:39:44 2018 +0200

    mesa/texture: Also check for LA texture when querying intensity component size
    
    Gallium may pick L16A16_FLOAT to represent GL_INTENSITY16F if no intensity
    format is provided by the driver. However, when calling
    
       glGetTexLevelParameteriv(..., GL_TEXTURE_INTENSITY_SIZE, ...)
    
    mesa will return a zero size because the actually used format has no
    intensity channel and as a fallback only the sizes of the red/green
    channels are checked.
    
    Also checking for LA sizes in the allocated texture resolves this problem.
    
    v2: Only check alpha channel size and return it (Marek)
        L and A size are always the same in this case.
    
    Fixes (on virgl):
      ext_framebuffer_multisample-fast-clear GL_ARB_texture_float *
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107832
    
    Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
    Reviewed-by: Marek Olšák <marek.olsak@amd.com>

 src/mesa/main/texparam.c | 5 +++++
 1 file changed, 5 insertions(+)




Can you check if this fixes the problem?
Comment 2 Gert Wollny 2018-10-02 17:56:31 UTC
Yes, it fixes the bug - I proposed and pushed the patch ;)

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.