gallivm: Make lp_build_sample_wrap_int usage more accurate.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 2 Jun 2010 12:08:30 +0000 (13:08 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 2 Jun 2010 12:24:26 +0000 (13:24 +0100)
Fixes mesa texwrap demo border with GL_CLAMP.

src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c

index 8bf78c1158c274e128525d4d948cba296f76b965..84c04fe272f5c8b13a540f6c3a7b44595afdf3ff 100644 (file)
@@ -415,10 +415,8 @@ is_simple_wrap_mode(unsigned mode)
 {
    switch (mode) {
    case PIPE_TEX_WRAP_REPEAT:
-   case PIPE_TEX_WRAP_CLAMP:
    case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
       return TRUE;
-   case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
    default:
       return FALSE;
    }
@@ -455,24 +453,17 @@ lp_build_sample_wrap_int(struct lp_build_sample_context *bld,
          coord = LLVMBuildURem(bld->builder, coord, length, "");
       break;
 
-   case PIPE_TEX_WRAP_CLAMP:
    case PIPE_TEX_WRAP_CLAMP_TO_EDGE:
-   case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
       coord = lp_build_max(int_coord_bld, coord, int_coord_bld->zero);
       coord = lp_build_min(int_coord_bld, coord, length_minus_one);
       break;
 
+   case PIPE_TEX_WRAP_CLAMP:
+   case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
    case PIPE_TEX_WRAP_MIRROR_REPEAT:
    case PIPE_TEX_WRAP_MIRROR_CLAMP:
    case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
    case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
-      /* FIXME */
-      _debug_printf("llvmpipe: failed to translate texture wrap mode %s\n",
-                    util_dump_tex_wrap(wrap_mode, TRUE));
-      coord = lp_build_max(uint_coord_bld, coord, uint_coord_bld->zero);
-      coord = lp_build_min(uint_coord_bld, coord, length_minus_one);
-      break;
-
    default:
       assert(0);
    }