mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
tgsi/sse: add support for system values
This commit is contained in:
parent
b550d8d76b
commit
e8154eeae5
1 changed files with 51 additions and 3 deletions
|
|
@ -163,6 +163,14 @@ get_immediate_base( void )
|
|||
reg_DX );
|
||||
}
|
||||
|
||||
static struct x86_reg
|
||||
get_system_value_base( void )
|
||||
{
|
||||
return x86_make_disp(
|
||||
get_machine_base(),
|
||||
Offset(struct tgsi_exec_machine, SystemValue) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Data access helpers.
|
||||
|
|
@ -228,6 +236,16 @@ get_temp(
|
|||
(vec * 4 + chan) * 16 );
|
||||
}
|
||||
|
||||
static struct x86_reg
|
||||
get_system_value(
|
||||
unsigned vec,
|
||||
unsigned chan )
|
||||
{
|
||||
return x86_make_disp(
|
||||
get_system_value_base(), /* base */
|
||||
(vec * 4 + chan) * 4 ); /* byte offset from base */
|
||||
}
|
||||
|
||||
static struct x86_reg
|
||||
get_coef(
|
||||
unsigned vec,
|
||||
|
|
@ -422,6 +440,30 @@ emit_tempf(
|
|||
get_temp( vec, chan ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a system value to xmm register
|
||||
* \param xmm the destination xmm register
|
||||
* \param vec the source system value register
|
||||
* \param chan src channel to fetch (X, Y, Z or W)
|
||||
*/
|
||||
static void
|
||||
emit_system_value(
|
||||
struct x86_function *func,
|
||||
unsigned xmm,
|
||||
unsigned vec,
|
||||
unsigned chan )
|
||||
{
|
||||
sse_movss(
|
||||
func,
|
||||
make_xmm( xmm ),
|
||||
get_system_value( vec, chan ) );
|
||||
sse_shufps(
|
||||
func,
|
||||
make_xmm( xmm ),
|
||||
make_xmm( xmm ),
|
||||
SHUF( 0, 0, 0, 0 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an xmm register with an input attrib coefficient (a0, dadx or dady)
|
||||
* \param xmm the destination xmm register
|
||||
|
|
@ -1281,8 +1323,15 @@ emit_fetch(
|
|||
swizzle );
|
||||
break;
|
||||
|
||||
case TGSI_FILE_INPUT:
|
||||
case TGSI_FILE_SYSTEM_VALUE:
|
||||
emit_system_value(
|
||||
func,
|
||||
xmm,
|
||||
reg->Register.Index,
|
||||
swizzle );
|
||||
break;
|
||||
|
||||
case TGSI_FILE_INPUT:
|
||||
emit_inputf(
|
||||
func,
|
||||
xmm,
|
||||
|
|
@ -2636,8 +2685,7 @@ emit_declaration(
|
|||
struct x86_function *func,
|
||||
struct tgsi_full_declaration *decl )
|
||||
{
|
||||
if( decl->Declaration.File == TGSI_FILE_INPUT ||
|
||||
decl->Declaration.File == TGSI_FILE_SYSTEM_VALUE ) {
|
||||
if( decl->Declaration.File == TGSI_FILE_INPUT ) {
|
||||
unsigned first, last, mask;
|
||||
unsigned i, j;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue