diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-06-18 09:06:25 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-06-26 09:08:37 -0700 |
commit | b51727ea28f1dbac8dcb519c0d06e64cdfb9974c (patch) | |
tree | 620b0833c8ee03845a15554fc8a7a925b17558cd /src/gallium/drivers/panfrost | |
parent | 1833827eac4461b6aa7388f6e64b8f08536686e5 (diff) |
panfrost/midgard: Handle negative immediate bias
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/disassemble.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/disassemble.c b/src/gallium/drivers/panfrost/midgard/disassemble.c index 58cfa131be5..ee1634430a1 100644 --- a/src/gallium/drivers/panfrost/midgard/disassemble.c +++ b/src/gallium/drivers/panfrost/midgard/disassemble.c @@ -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"); diff --git a/src/gallium/drivers/panfrost/midgard/midgard.h b/src/gallium/drivers/panfrost/midgard/midgard.h index 43fc3a64774..3d11126d953 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard.h +++ b/src/gallium/drivers/panfrost/midgard/midgard.h @@ -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; |