[Mesa-dev] [PATCH] i965: Move PSCDEPTH calculations from draw time to compile time.

Kenneth Graunke kenneth at whitecape.org
Wed Dec 3 17:58:38 PST 2014


On Tuesday, December 02, 2014 10:34:49 AM Matt Turner wrote:
> On Tue, Dec 2, 2014 at 3:50 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> > The "Pixel Shader Computed Depth Mode" value is entirely based on the
> > shader program, so we can easily do it at compile time.  This avoids the
> > if+switch on every 3DSTATE_WM (Gen7)/3DSTATE_PS_EXTRA (Gen8+) upload,
> > and shares a bit more code.
> >
> > This also simplifies the PMA stall code, making it match the formula
> > more closely, and drops a BRW_NEW_FRAGMENT_PROGRAM dependency.  (Note
> > that the previous comment was wrong - the code and the documentation
> > have != PSCDEPTH_OFF, not ==.)
> >
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > ---
> >  src/mesa/drivers/dri/i965/brw_context.h      |  2 ++
> >  src/mesa/drivers/dri/i965/brw_defines.h      | 17 +++++++++--------
> >  src/mesa/drivers/dri/i965/brw_wm.c           | 21 +++++++++++++++++++++
> >  src/mesa/drivers/dri/i965/gen7_wm_state.c    | 22 +++-------------------
> >  src/mesa/drivers/dri/i965/gen8_depth_state.c | 12 ++++--------
> >  src/mesa/drivers/dri/i965/gen8_ps_state.c    | 18 +-----------------
> >  6 files changed, 40 insertions(+), 52 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
> > index ec4b3dd..b4ddc17 100644
> > --- a/src/mesa/drivers/dri/i965/brw_context.h
> > +++ b/src/mesa/drivers/dri/i965/brw_context.h
> > @@ -390,6 +390,8 @@ struct brw_wm_prog_data {
> >        /** @} */
> >     } binding_table;
> >
> > +   uint8_t computed_depth_mode;
> 
> Presumably we should use the new enum type here (and below in the
> function call), and mark the enum definition PACKED.
> 
> With that,
> 
> Reviewed-by: Matt Turner <mattst88 at gmail.com>

Kind of painful - the enum is defined in brw_defines.h; this field is in
brw_context.h which doesn't #include that.  Minor benefit.

I guess we could move the enum declaration to brw_context.h, but...*shrug*?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141203/8dd65a15/attachment.sig>


More information about the mesa-dev mailing list