summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-08-09 20:59:44 -0600
committerBrian Paul <[email protected]>2012-08-16 09:01:31 -0600
commita2c1df4c9a7375bc5306e8cfd07a9f7087759a96 (patch)
tree92691c4d7786bd2decc45a393f4b5b2e496e685f /src/gallium/auxiliary/draw/draw_llvm.c
parentbef196c7929606bb8c7e9c06fe83a90fc0d95f09 (diff)
draw: index samplers and sampler_view state by shader type
So that we can handle GS state and other types of shaders in the future.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 3400661fb29..133aa5f6983 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -1351,8 +1351,8 @@ draw_llvm_make_variant_key(struct draw_llvm *llvm, char *store)
for (i = 0 ; i < key->nr_samplers; i++) {
lp_sampler_static_state(&sampler[i],
- llvm->draw->sampler_views[i],
- llvm->draw->samplers[i]);
+ llvm->draw->sampler_views[PIPE_SHADER_VERTEX][i],
+ llvm->draw->samplers[PIPE_SHADER_VERTEX][i]);
}
return key;
@@ -1394,14 +1394,16 @@ draw_llvm_set_sampler_state(struct draw_context *draw)
{
unsigned i;
- for (i = 0; i < draw->num_samplers; i++) {
+ for (i = 0; i < draw->num_samplers[PIPE_SHADER_VERTEX]; i++) {
struct draw_jit_texture *jit_tex = &draw->llvm->jit_context.textures[i];
if (draw->samplers[i]) {
- jit_tex->min_lod = draw->samplers[i]->min_lod;
- jit_tex->max_lod = draw->samplers[i]->max_lod;
- jit_tex->lod_bias = draw->samplers[i]->lod_bias;
- COPY_4V(jit_tex->border_color, draw->samplers[i]->border_color.f);
+ const struct pipe_sampler_state *s
+ = draw->samplers[PIPE_SHADER_VERTEX][i];
+ jit_tex->min_lod = s->min_lod;
+ jit_tex->max_lod = s->max_lod;
+ jit_tex->lod_bias = s->lod_bias;
+ COPY_4V(jit_tex->border_color, s->border_color.f);
}
}
}