diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-07-24 09:17:59 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-07-24 09:17:59 -0600 |
commit | 5b737b7df21b418c71f71af987a20c495b1133f8 (patch) | |
tree | 6aa3a54cb5d3c43f789488147f3b61b56e09c5fc /src/mesa/pipe/softpipe/sp_quad_fs.c | |
parent | f0636d9653d142bdf71475d2d2066f5c7c436978 (diff) | |
parent | 98eaf5503d0d7c4f18fab6910a08aba7a3d08639 (diff) |
Merge branch 'softpipe_0_1_branch' of git+ssh://brianp@git.freedesktop.org/git/mesa/mesa into softpipe_0_1_branch
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_quad_fs.c')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_quad_fs.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c index 7b1c90cba6..536365f219 100644 --- a/src/mesa/pipe/softpipe/sp_quad_fs.c +++ b/src/mesa/pipe/softpipe/sp_quad_fs.c @@ -37,6 +37,7 @@ #include "sp_context.h" #include "sp_headers.h" #include "sp_quad.h" +#include "core/tgsi_core.h" struct exec_machine { const struct setup_coefficient *coef; /**< will point to quad->coef */ @@ -180,8 +181,47 @@ shade_quad( struct quad_stage *qs, struct quad_header *quad ) #endif } -#if 0 - softpipe->run_fs( tri->fp, quad, &tri->outputs ); +#if 1 + /*softpipe->run_fs( tri->fp, quad, &tri->outputs );*/ + + { + struct tgsi_exec_machine machine; + struct tgsi_exec_vector inputs[FRAG_ATTRIB_MAX + 1]; + struct tgsi_exec_vector outputs[FRAG_ATTRIB_MAX + 1]; + struct tgsi_exec_vector *ainputs; + struct tgsi_exec_vector *aoutputs; + GLuint i, total; + + ainputs = (struct tgsi_exec_vector *) tgsi_align_128bit( inputs ); + aoutputs = (struct tgsi_exec_vector *) tgsi_align_128bit( outputs ); + + for( i = total = 0; i < PIPE_ATTRIB_MAX; i++ ) { + GLuint attr; + + attr = softpipe->fp_attr_to_slot[i]; + if( attr ) { + assert( total < FRAG_ATTRIB_MAX ); + assert( attr < FRAG_ATTRIB_MAX ); + assert( sizeof( ainputs[0] ) == sizeof( exec.attr[0] ) ); + + memcpy( + &ainputs[total], + exec.attr[attr], + sizeof( ainputs[0] ) ); + total++; + } + } + + tgsi_exec_machine_init( + &machine, + softpipe->fs.tokens ); + + machine.Inputs = ainputs; + machine.Outputs = aoutputs; + + tgsi_exec_machine_run( + &machine ); + } #else { GLuint attr = softpipe->fp_attr_to_slot[FRAG_ATTRIB_COL0]; |