Keith Whitwell pisze:
> On Fri, 2009-10-30 at 03:43 -0700, michal wrote:
>   
>> gallium: Add a PREDICATE register file.
>>
>> There's already a shader token that allows composition of predicated
>> instructions (tgsi_instruction_ext_predicate). However, there is no way
>> one can write to thos predicate registers in the first place.
>> ---
>>  src/gallium/include/pipe/p_shader_tokens.h |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/gallium/include/pipe/p_shader_tokens.h 
>> b/src/gallium/include/pipe/p_shader_tokens.h
>> index de338c4..6aa8b27 100644
>> --- a/src/gallium/include/pipe/p_shader_tokens.h
>> +++ b/src/gallium/include/pipe/p_shader_tokens.h
>> @@ -79,6 +79,7 @@ enum tgsi_file_type {
>>     TGSI_FILE_ADDRESS     =6,
>>     TGSI_FILE_IMMEDIATE   =7,
>>     TGSI_FILE_LOOP        =8,
>> +   TGSI_FILE_PREDICATE   =9,
>>     TGSI_FILE_COUNT      /**< how many TGSI_FILE_ types */
>>  };
>>     
>
> Michal,
>
> Is your expectation that all drivers become able to understand
> instructions with predicates?  That seems unreasonable.
>
> What is the expected way of setting a predicate register?  What
> functionality will use this?
>
>   
For example:

DECL IN[0..1]
DECL OUT[0]
DECL PRED[0]

1: MOV OUT[0], IN[0]
2: SGT PRED[0], IN[0], IN[1]
3: (PRED[0]) MOV OUT[0], IN[1]

In (2) we set each component of PRED[0] to 1.0 if the corresponding 
components of IN[0] are greater than IN[1], and to 0.0 otherwise.
In (3) we write IN[1] to only those components of OUT[0], for which the 
respective components of PRED[0] are non-zero.

> It seems there are three ways to do conditional execution in TGSI
> currently -- predicates, condition codes and IF/THEN/ELSE instructions.
>
> I'd really prefer to have at most two, and in fact preferably just one.
> Can you take a look at the three alternatives and figure out if one can
> be amputated?
>
>   
We could kill off the condition codes -- no driver uses that, and it's 
easier for us to emulate them with predicates than the other way round.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to