panfrost/midgard: Handle negative immediate bias

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-06-18 09:06:25 -07:00
parent 1833827eac
commit b51727ea28
2 changed files with 5 additions and 4 deletions

View file

@ -1208,14 +1208,15 @@ print_texture_word(uint32_t *word, unsigned tabs)
printf("lod = %d, ", texture->bias);
} else if (texture->bias || texture->bias_int) {
int bias_int = texture->bias_int;
signed 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 ? '+' : '=';
char sign = (bias >= 0.0) ? '+' : '-';
char operand = is_bias ? sign : '=';
printf("lod %c %f, ", operand, bias);
printf("lod %c %f, ", operand, fabsf(bias));
}
printf("\n");

View file

@ -624,7 +624,7 @@ __attribute__((__packed__))
* structure and bias_int is zero */
unsigned bias : 8;
unsigned bias_int : 8;
signed bias_int : 8;
unsigned texture_handle : 16;
unsigned sampler_handle : 16;