diff options
author | Roland Scheidegger <[email protected]> | 2010-03-19 16:29:22 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2010-03-19 16:29:22 +0100 |
commit | e5f0384ad06359aa1b9dc1b4bc6f475f7a119af2 (patch) | |
tree | fc59b9a33d8c689c8f5f5e8941fa92b38b740ad8 /src/gallium/state_trackers/vega/shader.c | |
parent | 8221a0e7f7eeff2c8201afcf4f5b46fc36dc8606 (diff) |
st/vega: fix up vega state tracker to use cso changes
use cso fragment sampler views instead of sampler textures.
since we don't really change views, try to store sampler views instead
of the textures to avoid having to recreate views most of the time.
Diffstat (limited to 'src/gallium/state_trackers/vega/shader.c')
-rw-r--r-- | src/gallium/state_trackers/vega/shader.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/gallium/state_trackers/vega/shader.c b/src/gallium/state_trackers/vega/shader.c index 0e71a507bff..f2ec24c57ff 100644 --- a/src/gallium/state_trackers/vega/shader.c +++ b/src/gallium/state_trackers/vega/shader.c @@ -119,7 +119,7 @@ static void setup_constant_buffer(struct shader *shader) static VGint blend_bind_samplers(struct vg_context *ctx, struct pipe_sampler_state **samplers, - struct pipe_texture **textures) + struct pipe_sampler_view **sampler_views) { VGBlendMode bmode = ctx->state.vg.blend_mode; @@ -132,15 +132,15 @@ static VGint blend_bind_samplers(struct vg_context *ctx, vg_prepare_blend_surface(ctx); samplers[2] = &ctx->blend_sampler; - textures[2] = stfb->blend_texture; + sampler_views[2] = stfb->blend_texture_view; - if (!samplers[0] || !textures[0]) { + if (!samplers[0] || !sampler_views[0]) { samplers[0] = samplers[2]; - textures[0] = textures[2]; + sampler_views[0] = sampler_views[2]; } - if (!samplers[1] || !textures[1]) { + if (!samplers[1] || !sampler_views[1]) { samplers[1] = samplers[0]; - textures[1] = textures[0]; + sampler_views[1] = sampler_views[0]; } return 1; @@ -151,7 +151,7 @@ static VGint blend_bind_samplers(struct vg_context *ctx, static void setup_samplers(struct shader *shader) { struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS]; - struct pipe_texture *textures[PIPE_MAX_SAMPLERS]; + struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS]; struct vg_context *ctx = shader->context; /* a little wonky: we use the num as a boolean that just says * whether any sampler/textures have been set. the actual numbering @@ -167,20 +167,20 @@ static void setup_samplers(struct shader *shader) samplers[1] = NULL; samplers[2] = NULL; samplers[3] = NULL; - textures[0] = NULL; - textures[1] = NULL; - textures[2] = NULL; - textures[3] = NULL; - - num += paint_bind_samplers(shader->paint, samplers, textures); - num += mask_bind_samplers(samplers, textures); - num += blend_bind_samplers(ctx, samplers, textures); + sampler_views[0] = NULL; + sampler_views[1] = NULL; + sampler_views[2] = NULL; + sampler_views[3] = NULL; + + num += paint_bind_samplers(shader->paint, samplers, sampler_views); + num += mask_bind_samplers(samplers, sampler_views); + num += blend_bind_samplers(ctx, samplers, sampler_views); if (shader->drawing_image && shader->image) - num += image_bind_samplers(shader->image, samplers, textures); + num += image_bind_samplers(shader->image, samplers, sampler_views); if (num) { cso_set_samplers(ctx->cso_context, 4, (const struct pipe_sampler_state **)samplers); - cso_set_sampler_textures(ctx->cso_context, 4, textures); + cso_set_fragment_sampler_views(ctx->cso_context, 4, sampler_views); } } |