}
+/**
+ * Generate a SVGA3dShaderInstToken for a SETP instruction (set predicate)
+ * using the given comparison operator (one of SVGA3DOPCOMP_xx).
+ */
+static INLINE SVGA3dShaderInstToken
+inst_token_setp(unsigned operator)
+{
+ SVGA3dShaderInstToken inst;
+
+ inst.value = 0;
+ inst.op = SVGA3DOP_SETP;
+ inst.control = operator;
+
+ return inst;
+}
+
+
/**
* Create an instance of a SVGA3dShaderDestToken.
* Note that this function is used to create tokens for output registers,
{
SVGA3dShaderDestToken pred_reg = dst_register( SVGA3DREG_PREDICATE, 0 );
SVGA3dShaderInstToken setp_token;
- setp_token = inst_token( SVGA3DOP_SETP );
switch (compare_func) {
case PIPE_FUNC_NEVER:
dst, fail );
break;
case PIPE_FUNC_LESS:
- setp_token.control = SVGA3DOPCOMP_LT;
+ setp_token = inst_token_setp(SVGA3DOPCOMP_LT);
break;
case PIPE_FUNC_EQUAL:
- setp_token.control = SVGA3DOPCOMP_EQ;
+ setp_token = inst_token_setp(SVGA3DOPCOMP_EQ);
break;
case PIPE_FUNC_LEQUAL:
- setp_token.control = SVGA3DOPCOMP_LE;
+ setp_token = inst_token_setp(SVGA3DOPCOMP_LE);
break;
case PIPE_FUNC_GREATER:
- setp_token.control = SVGA3DOPCOMP_GT;
+ setp_token = inst_token_setp(SVGA3DOPCOMP_GT);
break;
case PIPE_FUNC_NOTEQUAL:
- setp_token.control = SVGA3DOPCOMPC_NE;
+ setp_token = inst_token_setp(SVGA3DOPCOMPC_NE);
break;
case PIPE_FUNC_GEQUAL:
- setp_token.control = SVGA3DOPCOMP_GE;
+ setp_token = inst_token_setp(SVGA3DOPCOMP_GE);
break;
case PIPE_FUNC_ALWAYS:
return submit_op1( emit, inst_token( SVGA3DOP_MOV ),
*/
{
SVGA3dShaderDestToken pred_reg = dst_register( SVGA3DREG_PREDICATE, 0 );
- SVGA3dShaderInstToken setp_token;
struct src_register predsrc;
- setp_token = inst_token( SVGA3DOP_SETP );
- setp_token.control = SVGA3DOPCOMP_GT;
-
/* D3D vs GL semantics:
*/
if (0)
predsrc = swizzle(src0, 0, 0, 0, 0); /* GL */
/* SETP src0.xxyy, GT, {0}.x */
- if (!submit_op2( emit, setp_token, pred_reg,
+ if (!submit_op2( emit,
+ inst_token_setp(SVGA3DOPCOMP_GT),
+ pred_reg,
predsrc,
get_zero_immediate(emit)))
return FALSE;