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_state.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_state.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_state.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/ilo/ilo_state.c b/src/gallium/drivers/ilo/ilo_state.c index cc74d03c49b..ab2a4e9ae10 100644 --- a/src/gallium/drivers/ilo/ilo_state.c +++ b/src/gallium/drivers/ilo/ilo_state.c @@ -186,12 +186,13 @@ static void * ilo_create_sampler_state(struct pipe_context *pipe, const struct pipe_sampler_state *state) { - struct pipe_sampler_state *sampler; + struct ilo_context *ilo = ilo_context(pipe); + struct ilo_sampler_cso *sampler; - sampler = MALLOC_STRUCT(pipe_sampler_state); + sampler = MALLOC_STRUCT(ilo_sampler_cso); assert(sampler); - *sampler = *state; + ilo_gpe_init_sampler_cso(ilo->dev, state, sampler); return sampler; } @@ -201,10 +202,10 @@ bind_samplers(struct ilo_context *ilo, unsigned shader, unsigned start, unsigned count, void **samplers, bool unbind_old) { - struct pipe_sampler_state **dst = ilo->sampler[shader].states; + const struct ilo_sampler_cso **dst = ilo->sampler[shader].cso; unsigned i; - assert(start + count <= Elements(ilo->sampler[shader].states)); + assert(start + count <= Elements(ilo->sampler[shader].cso)); if (unbind_old) { if (!samplers) { @@ -237,7 +238,7 @@ bind_samplers(struct ilo_context *ilo, if (ilo->sampler[shader].count <= start + count) { count += start; - while (count > 0 && !ilo->sampler[shader].states[count - 1]) + while (count > 0 && !ilo->sampler[shader].cso[count - 1]) count--; ilo->sampler[shader].count = count; |