}
+/**
+ * Generate a SVGA3dShaderInstToken for the given SVGA3D shader opcode
+ * with the predication flag set.
+ */
+static INLINE SVGA3dShaderInstToken
+inst_token_predicated(unsigned opcode)
+{
+ SVGA3dShaderInstToken inst;
+
+ inst.value = 0;
+ inst.op = opcode;
+ inst.predicated = 1;
+
+ return inst;
+}
+
+
/**
* Create an instance of a SVGA3dShaderDestToken.
* Note that this function is used to create tokens for output registers,
struct src_register fail)
{
SVGA3dShaderDestToken pred_reg = dst_register( SVGA3DREG_PREDICATE, 0 );
- SVGA3dShaderInstToken setp_token, mov_token;
+ SVGA3dShaderInstToken setp_token;
setp_token = inst_token( SVGA3DOP_SETP );
switch (compare_func) {
src0, src1 ))
return FALSE;
- mov_token = inst_token( SVGA3DOP_MOV );
-
/* MOV dst, fail */
- if (!submit_op1( emit, mov_token, dst,
- fail ))
+ if (!submit_op1(emit, inst_token(SVGA3DOP_MOV), dst, fail))
return FALSE;
/* MOV dst, pass (predicated)
* Note that the predicate reg (and possible modifiers) is passed
* as the first source argument.
*/
- mov_token.predicated = 1;
- if (!submit_op2( emit, mov_token, dst,
- src( pred_reg ), pass ))
+ if (!submit_op2(emit,
+ inst_token_predicated(SVGA3DOP_MOV), dst,
+ src(pred_reg), pass))
return FALSE;
return TRUE;
*/
{
SVGA3dShaderDestToken pred_reg = dst_register( SVGA3DREG_PREDICATE, 0 );
- SVGA3dShaderInstToken setp_token, mov_token;
+ SVGA3dShaderInstToken setp_token;
struct src_register predsrc;
setp_token = inst_token( SVGA3DOP_SETP );
- mov_token = inst_token( SVGA3DOP_MOV );
-
setp_token.control = SVGA3DOPCOMP_GT;
/* D3D vs GL semantics:
* as the first source argument.
*/
if (dst.mask & TGSI_WRITEMASK_YZ) {
- mov_token.predicated = 1;
- if (!submit_op2( emit, mov_token,
+ if (!submit_op2( emit,
+ inst_token_predicated(SVGA3DOP_MOV),
writemask(dst, TGSI_WRITEMASK_YZ),
src( pred_reg ), src( tmp ) ))
return FALSE;