i915: Fix i830 polygon stipple from PBOs.
[mesa.git] / src / mesa / drivers / dri / i915 / i915_texstate.c
index 7cd6820cd51cac60c7449dcfdaaac2c8c4529b9c..902254833d4971177693c68693bc3efa15c68d59 100644 (file)
@@ -60,6 +60,8 @@ translate_texture_format(gl_format mesa_format, GLenum DepthMode)
       return MAPSURF_32BIT | MT_32BIT_ARGB8888;
    case MESA_FORMAT_XRGB8888:
       return MAPSURF_32BIT | MT_32BIT_XRGB8888;
+   case MESA_FORMAT_RGBA8888_REV:
+      return MAPSURF_32BIT | MT_32BIT_ABGR8888;
    case MESA_FORMAT_YCBCR_REV:
       return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
    case MESA_FORMAT_YCBCR:
@@ -129,7 +131,7 @@ translate_wrap_mode(GLenum wrap)
  * efficient, but this has gotten complex enough that we need
  * something which is understandable and reliable.
  */
-static GLboolean
+static bool
 i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
 {
    struct gl_context *ctx = &intel->ctx;
@@ -154,15 +156,15 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
    }
 
    if (!intel_finalize_mipmap_tree(intel, unit))
-      return GL_FALSE;
+      return false;
 
    /* Get first image here, since intelObj->firstLevel will get set in
     * the intel_finalize_mipmap_tree() call above.
     */
    firstImage = tObj->Image[0][tObj->BaseLevel];
 
-   drm_intel_bo_reference(intelObj->mt->region->buffer);
-   i915->state.tex_buffer[unit] = intelObj->mt->region->buffer;
+   drm_intel_bo_reference(intelObj->mt->region->bo);
+   i915->state.tex_buffer[unit] = intelObj->mt->region->bo;
    i915->state.tex_offset[unit] = 0; /* Always the origin of the miptree */
 
    format = translate_texture_format(firstImage->TexFormat,
@@ -220,7 +222,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
          mipFilt = MIPFILTER_LINEAR;
          break;
       default:
-         return GL_FALSE;
+         return false;
       }
 
       if (sampler->MaxAnisotropy > 1.0) {
@@ -240,7 +242,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
             magFilt = FILTER_LINEAR;
             break;
          default:
-            return GL_FALSE;
+            return false;
          }
       }
 
@@ -263,7 +265,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
       if (sampler->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB &&
           tObj->Target != GL_TEXTURE_3D) {
          if (tObj->Target == GL_TEXTURE_1D) 
-            return GL_FALSE;
+            return false;
 
          state[I915_TEXREG_SS2] |=
             (SS2_SHADOW_ENABLE |
@@ -307,7 +309,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
            wr == GL_CLAMP ||
            ws == GL_CLAMP_TO_BORDER ||
            wt == GL_CLAMP_TO_BORDER || wr == GL_CLAMP_TO_BORDER))
-         return GL_FALSE;
+         return false;
 
       /* Only support TEXCOORDMODE_CLAMP_EDGE and TEXCOORDMODE_CUBE (not 
        * used) when using cube map texture coordinates
@@ -315,7 +317,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
       if (tObj->Target == GL_TEXTURE_CUBE_MAP_ARB &&
           (((ws != GL_CLAMP) && (ws != GL_CLAMP_TO_EDGE)) ||
            ((wt != GL_CLAMP) && (wt != GL_CLAMP_TO_EDGE))))
-          return GL_FALSE;
+          return false;
 
       state[I915_TEXREG_SS3] = ss3;     /* SS3_NORMALIZED_COORDS */
 
@@ -354,7 +356,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
    }
 
 
-   I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), GL_TRUE);
+   I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(unit), true);
    /* memcmp was already disabled, but definitely won't work as the
     * region might now change and that wouldn't be detected:
     */
@@ -370,7 +372,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
    DBG(TEXTURE, "state[I915_TEXREG_MS4] = 0x%x\n", state[I915_TEXREG_MS4]);
 #endif
 
-   return GL_TRUE;
+   return true;
 }
 
 
@@ -379,7 +381,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3)
 void
 i915UpdateTextureState(struct intel_context *intel)
 {
-   GLboolean ok = GL_TRUE;
+   bool ok = true;
    GLuint i;
 
    for (i = 0; i < I915_TEX_UNITS && ok; i++) {
@@ -396,7 +398,7 @@ i915UpdateTextureState(struct intel_context *intel)
       case 0:{
             struct i915_context *i915 = i915_context(&intel->ctx);
             if (i915->state.active & I915_UPLOAD_TEX(i))
-               I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(i), GL_FALSE);
+               I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(i), false);
 
            if (i915->state.tex_buffer[i] != NULL) {
               drm_intel_bo_unreference(i915->state.tex_buffer[i]);
@@ -406,7 +408,7 @@ i915UpdateTextureState(struct intel_context *intel)
             break;
          }
       default:
-         ok = GL_FALSE;
+         ok = false;
          break;
       }
    }