[Mesa-dev] [PATCH 2/2] i915: set SPRITE_POINT_ENABLE bit only for points

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon Mar 12 01:04:01 PDT 2012


Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
---
 src/mesa/drivers/dri/i915/i915_state.c |    8 +++++++-
 src/mesa/drivers/dri/i915/i915_vtbl.c  |    9 +++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index 3c751e4..d7c6918 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -869,7 +869,13 @@ i915Enable(struct gl_context * ctx, GLenum cap, GLboolean state)
       break;
 
    case GL_POINT_SPRITE:
-      /* Handle it at intel_validate_sprite_point_enable() */
+      /*
+       * Handle it at intel_validate_sprite_point_enable()
+       *
+       * And final handle it in i915_reduced_primitive_state()
+       * because the hardware bit should only be set when
+       * rendering points
+       */
       break;
 
    case GL_POINT_SMOOTH:
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index e78dbc8..b131b19 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -87,6 +87,15 @@ i915_reduced_primitive_state(struct intel_context *intel, GLenum rprim)
 
    i915->intel.reduced_primitive = rprim;
 
+   /* Set SPRITE_POINT_ENABLE bit only for points */
+   if (rpim != GL_POINTS &&
+       i915->state.Ctx[I915_CTXREG_LIS4] & S4_SPRITE_POINT_ENABLE) {
+      INTEL_FIREVERTICES(intel);
+
+      i915->state.Ctx[I915_CTXREG_LIS4] &= ~S4_SPRITE_POINT_ENABLE;
+      I915_STATECHANGE(i915, I915_UPLOAD_CTX);
+   }
+
    if (st1 != i915->state.Stipple[I915_STPREG_ST1]) {
       INTEL_FIREVERTICES(intel);
 
-- 
1.7.7



More information about the mesa-dev mailing list