On Thu, Mar 01, 2012 at 09:54:46AM -0800, Eric Anholt wrote:
> On Thu, 23 Feb 2012 14:19:19 +0800, Yuanhan Liu <yuanhan....@linux.intel.com> 
> wrote:
> > The current code would ignore the point size specified by gl_PointSize
> > builtin variable in vertex shader on Pineview. This patch servers as
> > fixing that.
> > 
> > This patch fixes the following issues on Pineview:
> > webglc: 
> > https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/rendering/point-size.html
> > piglit: glsl-vs-point-size
> > 
> > NOTE: This is a candidate for stable release branches.
> > 
> > v2: pick Eric's nice tip for fixing this issue in hardware rendering.
> > 
> > Signed-off-by: Yuanhan Liu <yuanhan....@linux.intel.com>
> > ---
> >  src/mesa/drivers/dri/i915/i915_fragprog.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> > 
> > diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c 
> > b/src/mesa/drivers/dri/i915/i915_fragprog.c
> > index 4f016a3..2d60523 100644
> > --- a/src/mesa/drivers/dri/i915/i915_fragprog.c
> > +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
> > @@ -1361,6 +1361,10 @@ i915ValidateFragmentProgram(struct i915_context 
> > *i915)
> >        EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, S4_VFMT_XYZ, 12);
> >     }
> >  
> > +   /* Handle gl_PointSize builtin var here */
> > +   if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled)
> > +      EMIT_ATTR(_TNL_ATTRIB_POINTSIZE, EMIT_1F, S4_VFMT_POINT_WIDTH, 1);
> 
> All the other EMIT_ATTRs specify the number of bytes as the last arg.
> It seems like this code shouldn't have worked.

Actually, it does work ;)

Well, if the last arg specify the size in _bytes_, then this patch was
wrong. 

And here is the updated one:
-----

>From 5b4c96c0d8b57bf2759b9cdfd4dc1ddfcda2f56a Mon Sep 17 00:00:00 2001
From: Yuanhan Liu <yuanhan....@linux.intel.com>
Date: Thu, 23 Feb 2012 14:19:19 +0800
Subject: [PATCH] i915: fix wrong rendering of gl_PointSize on Pineview

The current code would ignore the point size specified by gl_PointSize
builtin variable in vertex shader on Pineview. This patch servers as
fixing that.

This patch fixes the following issues on Pineview:
webglc: 
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/rendering/point-size.html
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

v2: pick Eric's nice tip for fixing this issue in hardware rendering.
v3: the last arg of EMIT_ATTR specify the size in _byte_. (Eric)

Signed-off-by: Yuanhan Liu <yuanhan....@linux.intel.com>
---
 src/mesa/drivers/dri/i915/i915_fragprog.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c 
b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 4f016a3..5b7e93e 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -1361,6 +1361,10 @@ i915ValidateFragmentProgram(struct i915_context *i915)
       EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_3F_VIEWPORT, S4_VFMT_XYZ, 12);
    }
 
+   /* Handle gl_PointSize builtin var here */
+   if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled)
+      EMIT_ATTR(_TNL_ATTRIB_POINTSIZE, EMIT_1F, S4_VFMT_POINT_WIDTH, 4);
+
    if (inputsRead & FRAG_BIT_COL0) {
       intel->coloroffset = offset / 4;
       EMIT_ATTR(_TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, S4_VFMT_COLOR, 4);
-- 
1.7.7





_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to