diff options
author | Brian Paul <brianp@vmware.com> | 2009-12-04 09:14:40 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-12-04 09:14:42 -0700 |
commit | 04e12e31b252e7a18862c3ac386f302665edb6e7 (patch) | |
tree | 88eccdac9fa17ff15082c5b5154850052900d73e /src/gallium | |
parent | c6057ab8ff8991eac9c73c267696b386f8e56c68 (diff) |
llvmpipe: dynamic allocation of triangle a0/dadx/dady arrays
Much less memory per triangle now.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast.h | 10 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_tri.c | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h index ab21a77834..435993d44d 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.h +++ b/src/gallium/drivers/llvmpipe/lp_rast.h @@ -64,14 +64,12 @@ struct lp_rast_shader_inputs { const struct lp_rast_state *state; /* Attribute interpolation: - * * First coefficient is position. - * - * FIXME: reduce memory waste! + * These pointers point into the bin data buffer. */ - float a0[1 + PIPE_MAX_SHADER_INPUTS][4]; - float dadx[1 + PIPE_MAX_SHADER_INPUTS][4]; - float dady[1 + PIPE_MAX_SHADER_INPUTS][4]; + float (*a0)[4]; + float (*dadx)[4]; + float (*dady)[4]; }; diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index c21c465a75..3b71bc4c03 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -177,6 +177,16 @@ static void setup_tri_coefficients( struct setup_context *setup, { unsigned slot; + /* Allocate space for the a0, dadx and dady arrays + */ + { + unsigned bytes; + bytes = (setup->fs.nr_inputs + 1) * 4 * sizeof(float); + tri->inputs.a0 = get_data_aligned( &setup->data, bytes, 16 ); + tri->inputs.dadx = get_data_aligned( &setup->data, bytes, 16 ); + tri->inputs.dady = get_data_aligned( &setup->data, bytes, 16 ); + } + /* The internal position input is in slot zero: */ setup_fragcoord_coef(tri, 0, v1, v2, v3); |