Bug 77662 - Fail to render to different faces of depth-stencil cube map
Summary: Fail to render to different faces of depth-stencil cube map
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 13.0
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Nanley Chery
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-19 00:42 UTC by maister
Modified: 2016-11-18 20:02 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
APItrace with GL_R8 cube. (1015.20 KB, text/plain)
2014-04-19 00:42 UTC, maister
Details
APItrace with DEPTH24_STENCIL8 cube. (1.43 MB, text/plain)
2014-04-19 00:43 UTC, maister
Details
Expected result (PNG) (46.03 KB, image/png)
2014-04-19 00:43 UTC, maister
Details

Description maister 2014-04-19 00:42:22 UTC
Created attachment 97585 [details]
APItrace with GL_R8 cube.

Rendering to an offscreen GL_R8 cubemap (with d24s8 renderbuffer) works, but when trying to render to all faces of a an GL_DEPTH24_STENCIL8 cubemap (no color), only +X face appears to be renderable.

I've attached two traces (apitrace 4.0) when using GL_R8 cubemap and GL_DEPTH24_STENCIL8. I use 3.1 core (latest available on my card).
Comment 1 maister 2014-04-19 00:43:17 UTC
Created attachment 97586 [details]
APItrace with DEPTH24_STENCIL8 cube.
Comment 2 maister 2014-04-19 00:43:40 UTC
Created attachment 97587 [details]
Expected result (PNG)
Comment 3 Nanley Chery 2016-11-15 01:43:19 UTC
I've been able to reproduce this with a software rasterizer (via LIBGL_ALWAYS_SOFTWARE=1) on Mesa 13.
Comment 4 Nanley Chery 2016-11-18 20:02:17 UTC
Thank you for this bug report. This bug has recently been fixed by the following commit in the master branch of the Mesa git repo:

commit 63318d34acd4a5edb271d57adf3b01e2e52552f8
Author: Nanley Chery <nanley.g.chery@intel.com>
Date:   Tue Nov 15 16:42:23 2016 -0800

    mesa/fbobject: Update CubeMapFace when reusing textures

    Framebuffer attachments can be specified through FramebufferTexture*
    calls. Upon specifying a depth (or stencil) framebuffer attachment that
    internally reuses a texture, the cube map face of the new attachment
    would not be updated (defaulting to TEXTURE_CUBE_MAP_POSITIVE_X).
    Fix this issue by actually updating the CubeMapFace field.

    This bug manifested itself in BindFramebuffer calls performed on
    framebuffers whose stencil attachments internally reused a depth
    texture.  When binding a framebuffer, we walk through the framebuffer's
    attachments and update each one's corresponding gl_renderbuffer. Since
    the framebuffer's depth and stencil attachments may share a
    gl_renderbuffer and the walk visits the stencil attachment after
    the depth attachment, the uninitialized CubeMapFace forced rendering
    to TEXTURE_CUBE_MAP_POSITIVE_X.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77662
    Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
    Reviewed-by: Brian Paul <brianp@vmware.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.