+ struct pipe_sampler_state *state = mem_dup(sampler, sizeof *sampler);
+
+ if (LP_PERF & PERF_NO_MIP_LINEAR) {
+ if (state->min_mip_filter == PIPE_TEX_MIPFILTER_LINEAR)
+ state->min_mip_filter = PIPE_TEX_MIPFILTER_NEAREST;
+ }
+
+ if (LP_PERF & PERF_NO_MIPMAPS)
+ state->min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
+
+ if (LP_PERF & PERF_NO_LINEAR) {
+ state->mag_img_filter = PIPE_TEX_FILTER_NEAREST;
+ state->min_img_filter = PIPE_TEX_FILTER_NEAREST;
+ }
+
+ return state;