summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_texture.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-04-16 11:49:54 -0400
committerRob Clark <[email protected]>2017-04-18 16:32:00 -0400
commit0cc23ae77995bb258505a390dd57efd3e00803e6 (patch)
tree88bdf92618ed26ac18b7713a2acf86fb76650c43 /src/gallium/drivers/freedreno/freedreno_texture.c
parent5845b2045557681701c1aebd78755c5b65465344 (diff)
freedreno: make texture state an array
Make this an array indexed by shader stage, as is done elsewhere for other per-shader-stage state. This will simplify things as more shader stages are eventually added. 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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_texture.c b/src/gallium/drivers/freedreno/freedreno_texture.c
index 2d038927a5a..d27f47eb29f 100644
--- a/src/gallium/drivers/freedreno/freedreno_texture.c
+++ b/src/gallium/drivers/freedreno/freedreno_texture.c
@@ -91,12 +91,12 @@ 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) {
- bind_sampler_states(&ctx->fragtex, start, nr, hwcso);
ctx->dirty |= FD_DIRTY_FRAGTEX;
}
else if (shader == PIPE_SHADER_VERTEX) {
- bind_sampler_states(&ctx->verttex, start, nr, hwcso);
ctx->dirty |= FD_DIRTY_VERTTEX;
}
}
@@ -108,6 +108,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:
/* on a2xx, since there is a flat address space for textures/samplers,
@@ -116,14 +118,12 @@ fd_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
*
* (note: later gen's ignore FD_DIRTY_TEXSTATE so fine to set it)
*/
- if (nr != ctx->fragtex.num_textures)
+ if (nr != ctx->tex[PIPE_SHADER_FRAGMENT].num_textures)
ctx->dirty |= FD_DIRTY_TEXSTATE;
- set_sampler_views(&ctx->fragtex, start, nr, views);
ctx->dirty |= FD_DIRTY_FRAGTEX;
break;
case PIPE_SHADER_VERTEX:
- set_sampler_views(&ctx->verttex, start, nr, views);
ctx->dirty |= FD_DIRTY_VERTTEX;
break;
default: