summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-28 11:25:28 +0000
committerMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-28 11:25:28 +0000
commit6c24a1e0cf2928b8b45933cce9893bc34495981a (patch)
treeb2d4d787369c10c0c375db6b6076dca8326d56f4
parenta56fd7f7fd8c2e6098bffd07f62bc868d683bad4 (diff)
hwtest/pgraph: Fix handling of 0x8000 in vtx_*_*s methods on NV10.
-rw-r--r--hwtest/pgraph_class_celsius.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/hwtest/pgraph_class_celsius.cc b/hwtest/pgraph_class_celsius.cc
index c739ee5f..bb471a6f 100644
--- a/hwtest/pgraph_class_celsius.cc
+++ b/hwtest/pgraph_class_celsius.cc
@@ -3342,9 +3342,11 @@ public:
: SingleMthdTest(opt, seed, name, trapbit, cls, mthd), which(which) {}
};
-static uint32_t pgraph_celsius_short_to_float(int16_t val) {
+static uint32_t pgraph_celsius_short_to_float(struct pgraph_state *state, int16_t val) {
if (!val)
return 0;
+ if (state->chipset.chipset == 0x10 && val == -0x8000)
+ return 0x80000000;
bool sign = val < 0;
uint32_t res = (sign ? -val : val) << 8;
uint32_t exp = 0x7f + 15;
@@ -3367,7 +3369,7 @@ class MthdCelsiusVtxAttrShort : public SingleMthdTest {
if (!extr(exp.nsource, 1, 1)) {
for (int i = 0; i < 2; i++) {
int16_t v = extrs(val, i * 16, 16);
- exp.celsius_pipe_vtx[which * 4 + idx * 2 + i] = pgraph_celsius_short_to_float(v);
+ exp.celsius_pipe_vtx[which * 4 + idx * 2 + i] = pgraph_celsius_short_to_float(&exp, v);
}
if (idx == 0) {
exp.celsius_pipe_vtx[which * 4 + 2] = 0;