summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_state_sampler.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-09-07 14:52:39 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-09-07 15:02:08 +0100
commite4c76c02f77ed6e86537b546f4200f8f8132d114 (patch)
tree85ef1812f25eedbfffaeb63096e3046ee1ac349a /src/gallium/drivers/llvmpipe/lp_state_sampler.c
parentde8376e2f22a59a0bc18bb7ddab88ee3153678b8 (diff)
llvmpipe: Code generate the texture sampling inside the shader.
Finally a substantial performance improvement: framerates of apps using texturing tripled, and furthermore, enabling/disabling texturing only affects around 15% of the framerate, which means the bottleneck is now somewhere else. Generated texture sampling code is not complete though -- we always sample from the base level -- so final figures will be different.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_sampler.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_sampler.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
index 4fef541b1e..c69d90c723 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
@@ -98,6 +98,16 @@ llvmpipe_set_sampler_textures(struct pipe_context *pipe,
pipe_texture_reference(&llvmpipe->texture[i], tex);
lp_tex_tile_cache_set_texture(llvmpipe->tex_cache[i], tex);
+
+ if(tex) {
+ struct llvmpipe_texture *lp_tex = llvmpipe_texture(tex);
+ struct lp_jit_texture *jit_tex = &llvmpipe->jit_context.textures[i];
+ jit_tex->width = tex->width[0];
+ jit_tex->height = tex->height[0];
+ jit_tex->stride = lp_tex->stride[0];
+ if(!lp_tex->dt)
+ jit_tex->data = lp_tex->data;
+ }
}
llvmpipe->num_textures = num;