Lines Matching refs:sampler
82 upload_default_color(struct brw_context *brw, struct gl_sampler_object *sampler,
97 color[0] = sampler->BorderColor.f[0];
98 color[1] = sampler->BorderColor.f[0];
99 color[2] = sampler->BorderColor.f[0];
100 color[3] = sampler->BorderColor.f[0];
102 color[0] = sampler->BorderColor.f[0];
103 color[1] = sampler->BorderColor.f[1];
104 color[2] = sampler->BorderColor.f[2];
105 color[3] = sampler->BorderColor.f[3];
156 * Sets the sampler state for a single unit based off of the sampler key
162 struct brw_sampler_state *sampler)
177 sampler->ss0.min_filter = BRW_MAPFILTER_NEAREST;
178 sampler->ss0.mip_filter = BRW_MIPFILTER_NONE;
182 sampler->ss0.min_filter = BRW_MAPFILTER_LINEAR;
183 sampler->ss0.mip_filter = BRW_MIPFILTER_NONE;
186 sampler->ss0.min_filter = BRW_MAPFILTER_NEAREST;
187 sampler->ss0.mip_filter = BRW_MIPFILTER_NEAREST;
190 sampler->ss0.min_filter = BRW_MAPFILTER_LINEAR;
191 sampler->ss0.mip_filter = BRW_MIPFILTER_NEAREST;
194 sampler->ss0.min_filter = BRW_MAPFILTER_NEAREST;
195 sampler->ss0.mip_filter = BRW_MIPFILTER_LINEAR;
198 sampler->ss0.min_filter = BRW_MAPFILTER_LINEAR;
199 sampler->ss0.mip_filter = BRW_MIPFILTER_LINEAR;
208 sampler->ss0.min_filter = BRW_MAPFILTER_ANISOTROPIC;
209 sampler->ss0.mag_filter = BRW_MAPFILTER_ANISOTROPIC;
212 sampler->ss3.max_aniso = MIN2((gl_sampler->MaxAnisotropy - 2) / 2,
219 sampler->ss0.mag_filter = BRW_MAPFILTER_NEAREST;
223 sampler->ss0.mag_filter = BRW_MAPFILTER_LINEAR;
230 sampler->ss1.r_wrap_mode = translate_wrap_mode(gl_sampler->WrapR,
232 sampler->ss1.s_wrap_mode = translate_wrap_mode(gl_sampler->WrapS,
234 sampler->ss1.t_wrap_mode = translate_wrap_mode(gl_sampler->WrapT,
238 sampler->ss0.min_filter != sampler->ss0.mag_filter)
239 sampler->ss0.min_mag_neq = 1;
248 sampler->ss1.r_wrap_mode = BRW_TEXCOORDMODE_CUBE;
249 sampler->ss1.s_wrap_mode = BRW_TEXCOORDMODE_CUBE;
250 sampler->ss1.t_wrap_mode = BRW_TEXCOORDMODE_CUBE;
252 sampler->ss1.r_wrap_mode = BRW_TEXCOORDMODE_CLAMP;
253 sampler->ss1.s_wrap_mode = BRW_TEXCOORDMODE_CLAMP;
254 sampler->ss1.t_wrap_mode = BRW_TEXCOORDMODE_CLAMP;
262 sampler->ss1.t_wrap_mode = BRW_TEXCOORDMODE_WRAP;
269 /* Shadowing is "enabled" by emitting a particular sampler
273 sampler->ss0.shadow_function =
279 sampler->ss0.lod_bias = S_FIXED(CLAMP(texUnit->LodBias +
282 sampler->ss0.lod_preclamp = 1; /* OpenGL mode */
283 sampler->ss0.default_color_mode = 0; /* OpenGL/DX10 mode */
292 sampler->ss0.base_level = U_FIXED(0, 1);
294 sampler->ss1.max_lod = U_FIXED(CLAMP(gl_sampler->MaxLod, 0, 13), 6);
295 sampler->ss1.min_lod = U_FIXED(CLAMP(gl_sampler->MinLod, 0, 13), 6);
297 /* On Gen6+, the sampler can handle non-normalized texture
301 sampler->ss3.non_normalized_coord = 1;
307 sampler->ss2.default_color_pointer = brw->wm.sdc_offset[ss_index] >> 5;
310 sampler->ss2.default_color_pointer = (intel->batch.bo->offset +
314 brw->sampler.offset +
321 if (sampler->ss0.min_filter != BRW_MAPFILTER_NEAREST)
322 sampler->ss3.address_round |= BRW_ADDRESS_ROUNDING_ENABLE_U_MIN |
325 if (sampler->ss0.mag_filter != BRW_MAPFILTER_NEAREST)
326 sampler->ss3.address_round |= BRW_ADDRESS_ROUNDING_ENABLE_U_MAG |
344 /* ARB programs use the texture unit number as the sampler index, so we
347 brw->sampler.count = _mesa_fls(SamplersUsed);
349 if (brw->sampler.count == 0)
353 brw->sampler.count * sizeof(*samplers),
354 32, &brw->sampler.offset);
355 memset(samplers, 0, brw->sampler.count * sizeof(*samplers));
357 for (unsigned s = 0; s < brw->sampler.count; s++) {