mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
r300/compiler: shorten RC_*SWIZZLE* expressions
This commit is contained in:
parent
eb9dc2595f
commit
39d0ece5f5
4 changed files with 5 additions and 4 deletions
|
|
@ -146,7 +146,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da
|
|||
unsigned comp;
|
||||
for(comp = 0; comp < c->Constants[index].Size; ++comp) {
|
||||
if (c->Constants[index].u.Immediate[comp] == data) {
|
||||
*swizzle = RC_MAKE_SWIZZLE(comp, comp, comp, comp);
|
||||
*swizzle = RC_MAKE_SWIZZLE_SMEAR(comp);
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
|
@ -159,7 +159,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da
|
|||
if (free_index >= 0) {
|
||||
unsigned comp = c->Constants[free_index].Size++;
|
||||
c->Constants[free_index].u.Immediate[comp] = data;
|
||||
*swizzle = RC_MAKE_SWIZZLE(comp, comp, comp, comp);
|
||||
*swizzle = RC_MAKE_SWIZZLE_SMEAR(comp);
|
||||
return free_index;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -813,7 +813,7 @@ int radeonTransformDeriv(struct radeon_compiler* c,
|
|||
if (inst->U.I.Opcode != RC_OPCODE_DDX && inst->U.I.Opcode != RC_OPCODE_DDY)
|
||||
return 0;
|
||||
|
||||
inst->U.I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE);
|
||||
inst->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_1111;
|
||||
inst->U.I.SrcReg[1].Negate = RC_MASK_XYZW;
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ typedef enum {
|
|||
|
||||
#define RC_SWIZZLE_XYZW RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W)
|
||||
#define RC_SWIZZLE_XYZ0 RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO)
|
||||
#define RC_SWIZZLE_XYZZ RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z)
|
||||
#define RC_SWIZZLE_XXXX RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_X)
|
||||
#define RC_SWIZZLE_YYYY RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Y)
|
||||
#define RC_SWIZZLE_ZZZZ RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Z)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static GLuint build_dts(GLuint depthmode)
|
|||
{
|
||||
switch(depthmode) {
|
||||
default:
|
||||
case GL_LUMINANCE: return RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z);
|
||||
case GL_LUMINANCE: return RC_SWIZZLE_XYZZ;
|
||||
case GL_INTENSITY: return RC_SWIZZLE_XYZW;
|
||||
case GL_ALPHA: return RC_SWIZZLE_WWWW;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue