}
}
-uint32_t
+static uint32_t
translate_wrap_mode(struct brw_context *brw, GLenum wrap, bool using_nearest)
{
switch( wrap ) {
/**
* Upload SAMPLER_BORDER_COLOR_STATE.
*/
-void
+static void
upload_default_color(struct brw_context *brw,
const struct gl_sampler_object *sampler,
int unit,
mip_filter = BRW_MIPFILTER_LINEAR;
break;
default:
- break;
+ unreachable("not reached");
}
/* Select mag filter. */
intel_translate_shadow_compare_func(sampler->CompareFunc);
}
- const unsigned min_lod = U_FIXED(CLAMP(sampler->MinLod, 0, 13), 6);
- const unsigned max_lod = U_FIXED(CLAMP(sampler->MaxLod, 0, 13), 6);
+ const int lod_bits = brw->gen >= 7 ? 8 : 6;
+ const unsigned min_lod = U_FIXED(CLAMP(sampler->MinLod, 0, 13), lod_bits);
+ const unsigned max_lod = U_FIXED(CLAMP(sampler->MaxLod, 0, 13), lod_bits);
const int lod_bias =
- S_FIXED(CLAMP(texUnit->LodBias + sampler->LodBias, -16, 15), 6);
+ S_FIXED(CLAMP(texUnit->LodBias + sampler->LodBias, -16, 15), lod_bits);
const unsigned base_level = U_FIXED(0, 1);
uint32_t border_color_offset;
if (SamplersUsed & (1 << s)) {
const unsigned unit = prog->SamplerUnits[s];
if (ctx->Texture.Unit[unit]._Current) {
- if (brw->gen >= 7) {
- gen7_update_sampler_state(brw, unit,
- (struct gen7_sampler_state *)
- sampler_state);
- } else {
- brw_update_sampler_state(brw, unit,
- sampler_state,
- batch_offset_for_sampler_state);
- }
+ brw_update_sampler_state(brw, unit, sampler_state,
+ batch_offset_for_sampler_state);
}
}