summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_bitmap.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-08-09 20:59:44 -0600
committerBrian Paul <brianp@vmware.com>2012-08-16 09:01:31 -0600
commit6c8a13215813841703e7c2efa233e8d4cf517dfd (patch)
treef4dfc28372595c1fbb7f5680effb523bf59e3834 /src/mesa/state_tracker/st_cb_bitmap.c
parentcab2fed135bc1edf7b65ddca3236020638427061 (diff)
downloadmesa-6c8a13215813841703e7c2efa233e8d4cf517dfd.tar.gz
mesa-6c8a13215813841703e7c2efa233e8d4cf517dfd.tar.xz
mesa-6c8a13215813841703e7c2efa233e8d4cf517dfd.zip
st/mesa: combine vertex/fragment sampler state in arrays
As with other recent changes, put the vertex and fragment sampler state into arrays indexed by the shader type. This will let us easily add support for other types of shaders in the future.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_bitmap.c')
-rw-r--r--src/mesa/state_tracker/st_cb_bitmap.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index 7d9ccc1e5a..dbd778b4fc 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -481,10 +481,11 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
/* user samplers, plus our bitmap sampler */
{
struct pipe_sampler_state *samplers[PIPE_MAX_SAMPLERS];
- uint num = MAX2(fpv->bitmap_sampler + 1, st->state.num_fragment_samplers);
+ uint num = MAX2(fpv->bitmap_sampler + 1,
+ st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
uint i;
- for (i = 0; i < st->state.num_fragment_samplers; i++) {
- samplers[i] = &st->state.fragment_samplers[i];
+ for (i = 0; i < st->state.num_samplers[PIPE_SHADER_FRAGMENT]; i++) {
+ samplers[i] = &st->state.samplers[PIPE_SHADER_FRAGMENT][i];
}
samplers[fpv->bitmap_sampler] =
&st->bitmap.samplers[sv->texture->target != PIPE_TEXTURE_RECT];
@@ -496,8 +497,8 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
{
struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
uint num = MAX2(fpv->bitmap_sampler + 1,
- st->state.num_fragment_textures);
- memcpy(sampler_views, st->state.fragment_sampler_views,
+ st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
+ memcpy(sampler_views, st->state.sampler_views[PIPE_SHADER_FRAGMENT],
sizeof(sampler_views));
sampler_views[fpv->bitmap_sampler] = sv;
cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, num, sampler_views);