public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Olivier Galibert <galibert@pobox.com>
To: Eric Anholt <eric@anholt.net>
Cc: mesa-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/9] intel gen4-5: Fix backface/frontface selection when one one color is written to.
Date: Fri, 20 Jul 2012 20:03:47 +0200	[thread overview]
Message-ID: <20120720180346.GA90411@dspnet.fr> (raw)
In-Reply-To: <87mx2utlio.fsf@eliezer.anholt.net>

On Fri, Jul 20, 2012 at 10:01:03AM -0700, Eric Anholt wrote:
> > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > index 3f98137..3b62952 100644
> > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> > @@ -972,6 +972,15 @@ fs_visitor::calculate_urb_setup()
> >  	 if (c->key.vp_outputs_written & BITFIELD64_BIT(i)) {
> >  	    int fp_index = _mesa_vert_result_to_frag_attrib((gl_vert_result) i);
> >  
> > +            /* Special case: two-sided vertex option, vertex program
> > +             * only writes to the back color.  Map it to the
> > +             * associated front color location.
> > +             */
> > +            if (i >= VERT_RESULT_BFC0 && i <= VERT_RESULT_BFC1 &&
> > +                ctx->VertexProgram._TwoSideEnabled &&
> > +                urb_setup[i - VERT_RESULT_BFC0 + FRAG_ATTRIB_COL0] == -1)
> > +               fp_index = i - VERT_RESULT_BFC0 + FRAG_ATTRIB_COL0;
> 
> In the fs_visitor (and brw_wm_pass*), you don't get to look at ctx->
> state like that -- you're getting called once with some set of ctx
> state, but the program will get reused even if the ctx state changes.
> You'd have to get that state into the wm prog key, and use that, which
> would guarantee that you have the appropriate program code.

Ok.  OTOH, we don't actually *need* to look at TwoSideEnabled.  If the
rest of the condition triggers it's either correct or undefined
behaviour.  So we can do it systematically.

  OG.

  reply	other threads:[~2012-07-20 18:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 20:00 (no subject) Olivier Galibert
2012-07-19 20:00 ` [PATCH 1/9] intel gen4-5: fix the vue view in the fs Olivier Galibert
2012-07-26 17:18   ` [Mesa-dev] " Eric Anholt
2012-07-27  9:21     ` Olivier Galibert
2012-07-19 20:00 ` [PATCH 2/9] intel gen4-5: simplify the bfc copy in the sf Olivier Galibert
2012-07-26 17:20   ` Eric Anholt
2012-07-19 20:00 ` [PATCH 3/9] intel gen4-5: fix GL_VERTEX_PROGRAM_TWO_SIDE selection Olivier Galibert
2012-07-26 17:19   ` Eric Anholt
2012-07-19 20:00 ` [PATCH 4/9] intel gen4-5: Fix backface/frontface selection when one one color is written to Olivier Galibert
2012-07-20 17:01   ` Eric Anholt
2012-07-20 18:03     ` Olivier Galibert [this message]
2012-07-19 20:00 ` [PATCH 5/9] intel gen4-5: Compute the interpolation status for every variable in one place Olivier Galibert
2012-07-26 17:22   ` [Mesa-dev] " Eric Anholt
2012-07-27  9:12     ` Olivier Galibert
2012-07-19 20:00 ` [PATCH 6/9] intel gen4-5: Correctly setup the parameters in the sf Olivier Galibert
2012-07-19 20:00 ` [PATCH 7/9] intel gen4-5: Correctly handle flat vs. non-flat in the clipper Olivier Galibert
2012-07-19 20:00 ` [PATCH 8/9] intel gen4-5: Make noperspective clipping work Olivier Galibert
2012-07-19 20:00 ` [PATCH 9/9] intel gen4-5: Don't touch flatshaded values when clipping, only copy them Olivier Galibert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120720180346.GA90411@dspnet.fr \
    --to=galibert@pobox.com \
    --cc=eric@anholt.net \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mesa-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox