+ view[i] = NineBaseTexture9_GetSamplerView(state->texture[s], sRGB);
+ num_textures = i + 1;
+
+ if (update_sampler_derived(state, s) || (state->changed.sampler[s] & 0x05fe)) {
+ state->changed.sampler[s] = 0;
+ commit_samplers = TRUE;
+ nine_convert_sampler_state(device->cso, s, state->samp[s]);
+ }
+ } else {
+ /* Bind dummy sampler. We do not bind dummy sampler when
+ * it is not needed because it could add overhead. The
+ * dummy sampler should have r=g=b=0 and a=1. We do not
+ * unbind dummy sampler directly when they are not needed
+ * anymore, but they're going to be removed as long as texture
+ * or sampler states are changed. */
+ view[i] = device->dummy_sampler;
+ num_textures = i + 1;
+
+ memset(&samp, 0, sizeof(samp));
+ samp.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
+ samp.max_lod = 15.0f;
+ samp.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+ samp.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+ samp.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+ samp.min_img_filter = PIPE_TEX_FILTER_NEAREST;
+ samp.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
+ samp.compare_mode = PIPE_TEX_COMPARE_NONE;
+ samp.compare_func = PIPE_FUNC_LEQUAL;
+ samp.normalized_coords = 1;
+ samp.seamless_cube_map = 1;
+
+ cso_single_sampler(device->cso, PIPE_SHADER_FRAGMENT,
+ s - NINE_SAMPLER_PS(0), &samp);
+
+ commit_views = TRUE;