diff options
author | Brian Paul <[email protected]> | 2008-12-17 18:59:58 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-12-17 18:59:58 -0700 |
commit | 3ffd529ff19bf8dd7b022a267bf2afe44c7f0f65 (patch) | |
tree | e2e6059016cd83dd1af7d80a7cd6ca2965192617 /src/gallium/drivers/softpipe/sp_context.c | |
parent | d1c8af7c0a18340fdde45ade6f612939a3c8e62a (diff) |
softpipe: fix vertex shader texture sampling
Need to disable/bypass lambda calculation since derivatives of texcoords
are meaningless for adjacent vertices.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_context.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_context.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index 99b52748575..800f944838a 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -2,6 +2,7 @@ * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. + * Copyright 2008 VMware, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -221,12 +222,22 @@ softpipe_create( struct pipe_screen *screen, softpipe->quad[i].output = sp_quad_output_stage(softpipe); } + /* vertex shader samplers */ for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { - softpipe->tgsi.samplers[i].base.get_samples = sp_get_samples; - softpipe->tgsi.samplers[i].unit = i; - softpipe->tgsi.samplers[i].sp = softpipe; - softpipe->tgsi.samplers[i].cache = softpipe->tex_cache[i]; - softpipe->tgsi.samplers_list[i] = &softpipe->tgsi.samplers[i]; + softpipe->tgsi.vert_samplers[i].base.get_samples = sp_get_samples_vertex; + softpipe->tgsi.vert_samplers[i].unit = i; + softpipe->tgsi.vert_samplers[i].sp = softpipe; + softpipe->tgsi.vert_samplers[i].cache = softpipe->tex_cache[i]; + softpipe->tgsi.vert_samplers_list[i] = &softpipe->tgsi.vert_samplers[i]; + } + + /* fragment shader samplers */ + for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { + softpipe->tgsi.frag_samplers[i].base.get_samples = sp_get_samples_fragment; + softpipe->tgsi.frag_samplers[i].unit = i; + softpipe->tgsi.frag_samplers[i].sp = softpipe; + softpipe->tgsi.frag_samplers[i].cache = softpipe->tex_cache[i]; + softpipe->tgsi.frag_samplers_list[i] = &softpipe->tgsi.frag_samplers[i]; } /* @@ -237,7 +248,9 @@ softpipe_create( struct pipe_screen *screen, goto fail; draw_texture_samplers(softpipe->draw, - PIPE_MAX_SAMPLERS, softpipe->tgsi.samplers_list); + PIPE_MAX_SAMPLERS, + (struct tgsi_sampler **) + softpipe->tgsi.vert_samplers_list); softpipe->setup = sp_draw_render_stage(softpipe); if (!softpipe->setup) |