[Bug 109985] [SNB] INTEL_DEBUG=nohiz is likely broken for depth/stencil buffers
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Mar 29 23:53:45 UTC 2019
https://bugs.freedesktop.org/show_bug.cgi?id=109985
--- Comment #13 from Nanley Chery <nanleychery at gmail.com> ---
(In reply to asimiklit from comment #12)
> (In reply to Nanley Chery from comment #0)
> > For SNB, INTEL_DEBUG=nohiz seems to be broken in two places:
> >
> > 1. In miptree_create() in intel_mipmap_tree.c. Trying to create a
> > depth/stencil buffer will cause a depth miptree to be created without
> > stencil.
>
> As far as found this code disallows us to create combined depth/stencil on
> SNB:
> mesa_format mt_fmt = format;
> if (!_mesa_is_format_color_format(format) && devinfo->gen >= 6) {
> /* Fix up the Z miptree format for how we're splitting out separate
> * stencil. Gen7 expects there to be no stencil bits in its depth
> buffer.
> */
> mt_fmt = intel_depth_format_for_depthstencil_format(format);
> }
>
> Note: This code just replaces MESA_FORMAT_Z24_UNORM_S8_UINT by
> MESA_FORMAT_Z24_UNORM_X8_UINT
> but in this case 'mt_surf_usage' does not return a
> ISL_SURF_USAGE_STENCIL_BIT and that leads to
> an assertion: assert(src_surf->surf->usage &
> ISL_SURF_USAGE_STENCIL_BIT); in a blorp_blit function.
> PS: Actually I didn't check if this assertion actually matter.
>
> But just avoiding of this code doesn't make us happy too (
> Because we fail a choosing of a surf tiling method and
> "isl_surf_choose_tiling" always returns false.
>
> Now I am investigates a SNB PRM for the valid combinations of tiling methods
> with combined depth/stencil.
>
> Any advices or suggestions are welcome :)
>
The cause of this problem is that we have two non-equivalent conditions for
selecting the main miptree format and creating a separate stencil miptree: The
condition you mentioned above and the call to needs_separate_stencil(). One
solution is to refactor and reuse needs_separate_stencil() for the format
selection.
> >
> > 2. In isl_genX(emit_depth_stencil_hiz_s) in isl_emit_depth_stencil.c.
> > Emitting a depth/stencil buffer instruction will unconditionally force HiZ
> > on.
>
> It happens because we create a separate stencil here regardless "nohiz" flag
> (under SNB we always jump into 'true' branch in the following code):
>
> if (screen->devinfo.has_hiz_and_separate_stencil) {
> rb = intel_create_private_renderbuffer(screen,
> MESA_FORMAT_Z24_UNORM_X8_UINT,
> num_samples);
> _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, &rb->Base.Base);
> rb = intel_create_private_renderbuffer(screen, MESA_FORMAT_S_UINT8,
> num_samples);
> _mesa_attach_and_own_rb(fb, BUFFER_STENCIL, &rb->Base.Base);
> } else {
> /*
> * Use combined depth/stencil. Note that the renderbuffer is
> * attached to two attachment points.
> */
> rb = intel_create_private_renderbuffer(screen,
> MESA_FORMAT_Z24_UNORM_S8_UINT,
> num_samples);
> _mesa_attach_and_own_rb(fb, BUFFER_DEPTH, &rb->Base.Base);
> _mesa_attach_and_reference_rb(fb, BUFFER_STENCIL, &rb->Base.Base);
> }
>
> A separate stencil forces us to emit a "Hierarchical Depth Buffer Enable" as
> a TRUE because of:
> SNB PRM Vol 2 Part 1 about field 'Separate Stencil Buffer Enable':
> [DevSNB]: This field must be set to the same value (enabled or disabled)
> as Hierarchical Depth Buffer Enable
>
I see.
> So looks like we need to create a combined depth/stencil there for
> has_separate_stencil = false
> case but as you mentioned above we unable to create combined depth/stencil
> due to issue 1.
>
I'm not very familiar with this section of code. My understanding of it is that
we create object(s) to represent the depth-stencil portion of the default
framebuffer here. Sometime later we create a miptree for each object. If that's
true, we can get rid of the true branch. The miptree creation code will create
a separate stencil buffer internally.
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20190329/b893f3f2/attachment.html>
More information about the intel-3d-bugs
mailing list