};
void *
-tgsi_align_128bit(
- void *unaligned )
+tgsi_align_128bit(void *unaligned)
{
union pointer_hack ph;
}
unsigned
-tgsi_util_get_src_register_swizzle(
- const struct tgsi_src_register *reg,
- unsigned component )
+tgsi_util_get_src_register_swizzle(const struct tgsi_src_register *reg,
+ unsigned component)
{
switch (component) {
case TGSI_CHAN_X:
unsigned
tgsi_util_get_full_src_register_swizzle(
- const struct tgsi_full_src_register *reg,
- unsigned component )
+ const struct tgsi_full_src_register *reg,
+ unsigned component)
{
- return tgsi_util_get_src_register_swizzle(
- ®->Register,
- component );
+ return tgsi_util_get_src_register_swizzle(®->Register, component);
}
+
void
-tgsi_util_set_src_register_swizzle(
- struct tgsi_src_register *reg,
- unsigned swizzle,
- unsigned component )
+tgsi_util_set_src_register_swizzle(struct tgsi_src_register *reg,
+ unsigned swizzle,
+ unsigned component)
{
- switch( component ) {
+ switch (component) {
case 0:
reg->SwizzleX = swizzle;
break;
reg->SwizzleW = swizzle;
break;
default:
- assert( 0 );
+ assert(0);
}
}
+
unsigned
tgsi_util_get_full_src_register_sign_mode(
- const struct tgsi_full_src_register *reg,
- unsigned component )
+ const struct tgsi_full_src_register *reg,
+ UNUSED unsigned component)
{
unsigned sign_mode;
- if( reg->Register.Absolute ) {
+ if (reg->Register.Absolute) {
/* Consider only the post-abs negation. */
- if( reg->Register.Negate ) {
+ if (reg->Register.Negate) {
sign_mode = TGSI_UTIL_SIGN_SET;
}
else {
}
}
else {
- if( reg->Register.Negate ) {
+ if (reg->Register.Negate) {
sign_mode = TGSI_UTIL_SIGN_TOGGLE;
}
else {
return sign_mode;
}
+
void
-tgsi_util_set_full_src_register_sign_mode(
- struct tgsi_full_src_register *reg,
- unsigned sign_mode )
+tgsi_util_set_full_src_register_sign_mode(struct tgsi_full_src_register *reg,
+ unsigned sign_mode)
{
- switch (sign_mode)
- {
+ switch (sign_mode) {
case TGSI_UTIL_SIGN_CLEAR:
reg->Register.Negate = 0;
reg->Register.Absolute = 1;
break;
default:
- assert( 0 );
+ assert(0);
}
}
+
/**
* Determine which channels of the specificed src register are effectively
* used by this instruction.
read_mask = TGSI_WRITEMASK_XYZ;
break;
+ case TGSI_OPCODE_DSEQ:
+ case TGSI_OPCODE_DSNE:
+ case TGSI_OPCODE_DSLT:
+ case TGSI_OPCODE_DSGE:
case TGSI_OPCODE_DP4:
case TGSI_OPCODE_PK4B:
case TGSI_OPCODE_PK4UB:
case TGSI_OPCODE_D2F:
+ case TGSI_OPCODE_D2I:
+ case TGSI_OPCODE_D2U:
case TGSI_OPCODE_I2F:
case TGSI_OPCODE_U2F:
+ case TGSI_OPCODE_U64SEQ:
+ case TGSI_OPCODE_U64SNE:
+ case TGSI_OPCODE_U64SLT:
+ case TGSI_OPCODE_U64SGE:
case TGSI_OPCODE_U642F:
+ case TGSI_OPCODE_I64SLT:
+ case TGSI_OPCODE_I64SGE:
case TGSI_OPCODE_I642F:
read_mask = TGSI_WRITEMASK_XYZW;
break;
case TGSI_OPCODE_TXL2:
case TGSI_OPCODE_LODQ:
case TGSI_OPCODE_TG4: {
- unsigned dim_layer_shadow =
+ unsigned dim_layer =
tgsi_util_get_texture_coord_dim(inst->Texture.Texture);
- unsigned dim_layer, dim;
+ unsigned dim_layer_shadow, dim;
- /* Remove shadow. */
+ /* Add shadow. */
if (tgsi_is_shadow_target(inst->Texture.Texture)) {
- dim_layer = dim_layer_shadow - 1;
+ dim_layer_shadow = dim_layer + 1;
if (inst->Texture.Texture == TGSI_TEXTURE_SHADOW1D)
- dim_layer = 1;
+ dim_layer_shadow = 3;
} else {
- dim_layer = dim_layer_shadow;
+ dim_layer_shadow = dim_layer;
}
/* Remove layer. */
* sample index.
*/
int
-tgsi_util_get_texture_coord_dim(unsigned tgsi_tex)
+tgsi_util_get_texture_coord_dim(enum tgsi_texture_type tgsi_tex)
{
/*
* Depending on the texture target, (src0.xyzw, src1.x) is interpreted
/**
- * Given a TGSI_TEXTURE_x target, return the src register index for the
- * shadow reference coordinate.
+ * Given a TGSI_TEXTURE_x target, return register component where the
+ * shadow reference/distance coordinate is found. Typically, components
+ * 0 and 1 are the (s,t) texcoords and component 2 or 3 hold the shadow
+ * reference value. But if we return 4, it means the reference value is
+ * found in the 0th component of the second coordinate argument to the
+ * TEX2 instruction.
*/
int
-tgsi_util_get_shadow_ref_src_index(unsigned tgsi_tex)
+tgsi_util_get_shadow_ref_src_index(enum tgsi_texture_type tgsi_tex)
{
switch (tgsi_tex) {
case TGSI_TEXTURE_SHADOW1D:
boolean
-tgsi_is_shadow_target(unsigned target)
+tgsi_is_shadow_target(enum tgsi_texture_type target)
{
switch (target) {
case TGSI_TEXTURE_SHADOW1D: