summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_hw_context.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2012-09-10 04:06:20 +0200
committerMarek Olšák <maraeo@gmail.com>2012-09-13 20:18:44 +0200
commit3fe78594b1221358f4ba96072d952e33a7e54a76 (patch)
treecc693127cb02513bca3c205b1a1cb95755a46a0c /src/gallium/drivers/r600/r600_hw_context.c
parent6c86124157da86ced9f9574ec49480f4abbd7e8c (diff)
r600g: do fine-grained sampler state updates
Update only those sampler states which are changed in a shader stage, instead of always updating all sampler states in the shader stage. That requires keeping a bitmask of those states which are enabled, and those states which are dirty at a given point (subset of enabled states). This is similar to how sampler views, constant buffers, and vertex buffers are handled. Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_hw_context.c')
-rw-r--r--src/gallium/drivers/r600/r600_hw_context.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c
index 1db5f0d645c..020f626cde9 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -1043,9 +1043,12 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags)
r600_atom_dirty(ctx, &ctx->alphatest_state.atom);
r600_atom_dirty(ctx, &ctx->cb_misc_state.atom);
r600_atom_dirty(ctx, &ctx->db_misc_state.atom);
- /* reemit sampler, will only matter if atom_sampler.num_dw != 0 */
- r600_atom_dirty(ctx, &ctx->vs_samplers.atom_sampler);
- r600_atom_dirty(ctx, &ctx->ps_samplers.atom_sampler);
+
+ ctx->vs_samplers.states.dirty_mask = ctx->vs_samplers.states.enabled_mask;
+ ctx->ps_samplers.states.dirty_mask = ctx->ps_samplers.states.enabled_mask;
+ r600_sampler_states_dirty(ctx, &ctx->vs_samplers.states);
+ r600_sampler_states_dirty(ctx, &ctx->ps_samplers.states);
+
if (ctx->chip_class <= R700) {
r600_atom_dirty(ctx, &ctx->seamless_cube_map.atom);
}