aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_texture.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-08-21 17:13:11 +0100
committerKeith Whitwell <[email protected]>2009-08-21 18:14:19 +0100
commit4fc7d0345a18042a79686940fb7cc4e698cc9192 (patch)
treeb039e7d5e5e673a8677926050df0648c17bfd0fc /src/gallium/drivers/softpipe/sp_texture.c
parentb1cc196e6d18494348c2974aad5d85d1b8281ce0 (diff)
softpipe: rework texture sampling code
Split into component pieces, stitch together at runtime using function pointers. Make it possible to utilize the existing fastpaths as image-level filters for generic mip-filtering routines. Remove special case for rectangle filtering, as it can now be handled by the 2d path. As most of the mesa demo texturing was already covered by fast paths, its harder to find examples of speedups, but tunnel gets a boost as mip-nearest filtering is now able to access the img_2d_linear_wrap_POT functions for sampling within a mipmap level.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_texture.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c
index 0c84375bf10..a3a54dada4a 100644
--- a/src/gallium/drivers/softpipe/sp_texture.c
+++ b/src/gallium/drivers/softpipe/sp_texture.c
@@ -120,16 +120,20 @@ softpipe_displaytarget_layout(struct pipe_screen *screen,
static struct pipe_texture *
softpipe_texture_create(struct pipe_screen *screen,
- const struct pipe_texture *templat)
+ const struct pipe_texture *template)
{
struct softpipe_texture *spt = CALLOC_STRUCT(softpipe_texture);
if (!spt)
return NULL;
- spt->base = *templat;
+ spt->base = *template;
pipe_reference_init(&spt->base.reference, 1);
spt->base.screen = screen;
+ spt->pot = (util_is_power_of_two(template->width[0]) &&
+ util_is_power_of_two(template->height[0]) &&
+ util_is_power_of_two(template->depth[0]));
+
if (spt->base.tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) {
if (!softpipe_displaytarget_layout(screen, spt))
goto fail;