Bug 93704 - Stencil blits from targets other than GL_TEXTURE_2D or GL_TEXTURE_2D_MULTISAMPLE are probably broken
Summary: Stencil blits from targets other than GL_TEXTURE_2D or GL_TEXTURE_2D_MULTISAM...
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
Depends on:
Reported: 2016-01-14 02:46 UTC by Ian Romanick
Modified: 2019-09-25 18:55 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Description Ian Romanick 2016-01-14 02:46:09 UTC
The setup_program function in brw_meta_stencil_blit.c (http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c#n282) can only generate shader variations for GL_TEXTURE_2D and GL_TEXTURE_2D_MULTISAMPLE.  However, if I add an assertion

   assert(target == GL_TEXTURE_2D || target == GL_TEXTURE_2D_MULTISAMPLE);

at the single caller of the function, the arb_stencil_texturing-blit_corrupts_state test (http://patchwork.freedesktop.org/patch/70427/) fails the assertion for every other target.  That indicates to me that blits from those other targets probably don't work.

We need a test like arb_stencil_texturing-blit_corrupts_state that verifies the result of blitting from every possible texture target.  It shouldn't be too hard to adapt the existing arb_stencil_texturing-draw test.
Comment 1 Ian Romanick 2016-01-14 04:37:43 UTC
And... that is the only test that fails the assertion. :(

Looking back at the GIT history, it appears that GL_TEXTURE_2D and GL_TEXTURE_2D_MULTISAMPLE
Comment 2 Ian Romanick 2016-01-14 04:40:57 UTC
Looking back at the GIT history, it appears that GL_TEXTURE_2D and GL_TEXTURE_2D_MULTISAMPLE were the only targets supported when GL_ARB_stencil_texturing did not exist.  A renderbuffer was the only way to get stencil because internally we use separate stencil on these GENs even for packed depth / stencil targets.  _mesa_meta_bind_rb_as_tex_image would only generate those two targets.

When support for GL_ARB_stencil_texturing was added for GEN8+, we had only one test in piglit.  It didn't hit the non-GL_TEXTURE_2D* path, so nobody noticed.
Comment 3 Ian Romanick 2016-01-14 18:40:38 UTC
Inspecting brw_meta_stencil_blit, I believe it is also broken for blitting to anything other than the mipmap 0.
Comment 4 GitLab Migration User 2019-09-25 18:55:49 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1508.

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.