diff options
author | Rob Clark <[email protected]> | 2017-04-15 10:04:55 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2017-04-18 16:32:00 -0400 |
commit | 4299849ec7a873edf46a3a366749282fdec020fe (patch) | |
tree | d1fdc58b6fc65ad2c9fdbe096a4c3acd4eea3a6b /src/gallium/drivers/freedreno/freedreno_texture.c | |
parent | d7fa7f5e7eafed8bb88f7e0b9ba4261a76ad9c95 (diff) |
freedreno: refactor dirty state handling
In particular, move per-shader-stage info out to a seperate array of
enum's indexed by shader stage. This will make it easier to add more
shader stages as well as new per-stage state (like SSBOs).
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_texture.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_texture.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_texture.c b/src/gallium/drivers/freedreno/freedreno_texture.c index e9d90aa3a77..1487f7441c9 100644 --- a/src/gallium/drivers/freedreno/freedreno_texture.c +++ b/src/gallium/drivers/freedreno/freedreno_texture.c @@ -92,13 +92,8 @@ fd_sampler_states_bind(struct pipe_context *pctx, struct fd_context *ctx = fd_context(pctx); bind_sampler_states(&ctx->tex[shader], start, nr, hwcso); - - if (shader == PIPE_SHADER_FRAGMENT) { - ctx->dirty |= FD_DIRTY_FRAGTEX; - } - else if (shader == PIPE_SHADER_VERTEX) { - ctx->dirty |= FD_DIRTY_VERTTEX; - } + ctx->dirty_shader[shader] |= FD_DIRTY_SHADER_TEX; + ctx->dirty |= FD_DIRTY_TEX; } void @@ -109,17 +104,8 @@ fd_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader, struct fd_context *ctx = fd_context(pctx); set_sampler_views(&ctx->tex[shader], start, nr, views); - - switch (shader) { - case PIPE_SHADER_FRAGMENT: - ctx->dirty |= FD_DIRTY_FRAGTEX; - break; - case PIPE_SHADER_VERTEX: - ctx->dirty |= FD_DIRTY_VERTTEX; - break; - default: - break; - } + ctx->dirty_shader[shader] |= FD_DIRTY_SHADER_TEX; + ctx->dirty |= FD_DIRTY_TEX; } void |