}
}
+static bool
+texture_op_takes_bias(unsigned op)
+{
+ return op == TEXTURE_OP_NORMAL;
+}
+
#undef DEFINE_CASE
static void
/* Specific format in question */
print_texture_format(texture->format);
- /* Instruction "modifiers" parallel the ALU instructions. First group
- * are modifiers that act alone */
+ /* Instruction "modifiers" parallel the ALU instructions. */
if (!texture->filter)
printf(".raw");
if (texture->last)
printf(".last");
- /* Second set are modifiers which take an extra argument each */
-
- if (texture->bias)
- printf(".bias");
-
printf(" ");
print_texture_reg(texture->out_full, texture->out_reg_select, texture->out_upper);
if (texture->lod_register) {
/* TODO: Decode */
- printf("lod/bias/grad reg 0x%X, ", texture->bias);
- } else if (texture->bias) {
- printf("%f /* %d */, ", texture->bias / 256.0f, texture->bias);
+ printf("lod/bias/grad reg 0x%X (%X), ", texture->bias, texture->bias_int);
+ } else if (texture->bias || texture->bias_int) {
+ int bias_int = texture->bias_int;
+ float bias_frac = texture->bias / 256.0f;
+ float bias = bias_int + bias_frac;
+
+ bool is_bias = texture_op_takes_bias(texture->op);
+ char operand = is_bias ? '+' : '=';
+
+ printf("lod %c %f, ", operand, bias);
}
printf("\n");
texture->unknown4 ||
texture->unknownA ||
texture->unknownB ||
- texture->unknown8 ||
- texture->unknown9) {
+ texture->unknown8) {
printf("// unknown2 = 0x%x\n", texture->unknown2);
printf("// unknown3 = 0x%x\n", texture->unknown3);
printf("// unknown4 = 0x%x\n", texture->unknown4);
printf("// unknownA = 0x%x\n", texture->unknownA);
printf("// unknownB = 0x%x\n", texture->unknownB);
printf("// unknown8 = 0x%x\n", texture->unknown8);
- printf("// unknown9 = 0x%x\n", texture->unknown9);
}
if (texture->offset_unknown4 ||