diff options
author | Chia-I Wu <[email protected]> | 2013-05-31 11:52:47 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2013-06-07 11:13:15 +0800 |
commit | b3c9e2161f22c3c6b8b2fc83ea4bc7ea883329d7 (patch) | |
tree | 0d0a4a2ed95f136079966844681ce71c80ae23e2 /src/gallium/drivers/ilo/ilo_shader.c | |
parent | 99725d2f8ae2e2d0dd1e80ac05b127c7f99778d3 (diff) |
ilo: introduce sampler CSO
Introduce ilo_sampler_cso and initialize it in create_sampler_state(). This
saves us from having to perform CPU-intensive calculations to construct
hardware sampler states in draw_vbo().
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_shader.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_shader.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gallium/drivers/ilo/ilo_shader.c b/src/gallium/drivers/ilo/ilo_shader.c index 76ba7f04c66..754b59baec2 100644 --- a/src/gallium/drivers/ilo/ilo_shader.c +++ b/src/gallium/drivers/ilo/ilo_shader.c @@ -79,8 +79,8 @@ ilo_shader_variant_init(struct ilo_shader_variant *variant, for (i = 0; i < info->num_samplers; i++) { const struct pipe_sampler_view *view = ilo->view[info->type].states[i]; - const struct pipe_sampler_state *sampler = - ilo->sampler[info->type].states[i]; + const struct ilo_sampler_cso *sampler = + ilo->sampler[info->type].cso[i]; if (view) { variant->sampler_view_swizzles[i].r = view->swizzle_r; @@ -106,13 +106,10 @@ ilo_shader_variant_init(struct ilo_shader_variant *variant, * the HW wrap mode is set to BRW_TEXCOORDMODE_CLAMP_BORDER, and we need * to manually saturate the texture coordinates. */ - if (sampler && sampler->min_img_filter != PIPE_TEX_FILTER_NEAREST) { - if (sampler->wrap_s == PIPE_TEX_WRAP_CLAMP) - variant->saturate_tex_coords[0] |= 1 << i; - if (sampler->wrap_t == PIPE_TEX_WRAP_CLAMP) - variant->saturate_tex_coords[1] |= 1 << i; - if (sampler->wrap_r == PIPE_TEX_WRAP_CLAMP) - variant->saturate_tex_coords[2] |= 1 << i; + if (sampler) { + variant->saturate_tex_coords[0] |= sampler->saturate_s << i; + variant->saturate_tex_coords[1] |= sampler->saturate_t << i; + variant->saturate_tex_coords[2] |= sampler->saturate_r << i; } } } |