mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
Execute fs tokens.
Fix align128 bug.
This commit is contained in:
parent
4824c342c8
commit
98eaf5503d
2 changed files with 53 additions and 6 deletions
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -1,15 +1,22 @@
|
|||
#include "tgsi_platform.h"
|
||||
#include "tgsi_core.h"
|
||||
|
||||
union pointer_hack
|
||||
{
|
||||
void *pointer;
|
||||
unsigned long long uint64;
|
||||
};
|
||||
|
||||
void *
|
||||
tgsi_align_128bit(
|
||||
void *unaligned )
|
||||
{
|
||||
GLuint *ptr, addr;
|
||||
union pointer_hack ph;
|
||||
|
||||
ptr = (GLuint *) unaligned;
|
||||
addr = (*(GLuint *) &ptr + 15) & ~15;
|
||||
return *(void **) &addr;
|
||||
ph.uint64 = 0;
|
||||
ph.pointer = unaligned;
|
||||
ph.uint64 = (ph.uint64 + 15) & ~15;
|
||||
return ph.pointer;
|
||||
}
|
||||
|
||||
GLuint
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue