llvmpipe: Don't assert due to unsupported texture wrap modes.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 16 Sep 2009 15:12:22 +0000 (16:12 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 16 Sep 2009 19:42:09 +0000 (20:42 +0100)
Issue a warning and fallback to clamping.

src/gallium/drivers/llvmpipe/lp_bld_sample_soa.c

index 08b1dc10f3641a3cbf77da2f557496da98733c41..8ca1be6f1be80e826a136b59d5cb2c101e5cfa2b 100644 (file)
@@ -208,6 +208,11 @@ lp_build_sample_wrap(struct lp_build_sample_context *bld,
    case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE:
    case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER:
       /* FIXME */
+      _debug_printf("warning: failed to translate texture wrap mode %u\n", wrap_mode);
+      coord = lp_build_max(int_coord_bld, coord, int_coord_bld->zero);
+      coord = lp_build_min(int_coord_bld, coord, length_minus_one);
+      break;
+
    default:
       assert(0);
    }