gallivm: add some assertions in special-case sampler code
authorBrian Paul <brianp@vmware.com>
Thu, 29 Apr 2010 15:13:47 +0000 (09:13 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 29 Apr 2010 15:39:17 +0000 (09:39 -0600)
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c

index 54ef921678d081b99e6d3cfd3ff929d07d29074c..74dc9e1d812373c9e3c9ec9c6c1b55ae9d8a4003 100644 (file)
@@ -1830,6 +1830,11 @@ lp_build_sample_2d_linear_aos(struct lp_build_sample_context *bld,
    LLVMValueRef unswizzled[4];
    LLVMValueRef stride;
 
+   assert(bld->static_state->target == PIPE_TEXTURE_2D);
+   assert(bld->static_state->min_img_filter == PIPE_TEX_FILTER_LINEAR);
+   assert(bld->static_state->mag_img_filter == PIPE_TEX_FILTER_LINEAR);
+   assert(bld->static_state->min_mip_filter == PIPE_TEX_MIPFILTER_NONE);
+
    lp_build_context_init(&i32, builder, lp_type_int_vec(32));
    lp_build_context_init(&h16, builder, lp_type_ufixed(16));
    lp_build_context_init(&u8n, builder, lp_type_unorm(8));