summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-29 02:15:27 +0000
committerMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-29 02:15:27 +0000
commit89d3fc5a24d8fc9da0b5b24c29763e6a9b5ffafe (patch)
treeae8cc0b805c7d82842966a4b836a660636548b18
parent7b6eeaf220f515dfd8d22cb58e2d4cf4f42cb53b (diff)
hwtest/pgraph: Model misc PIPE state, test edge_flag and begin_end methods.
-rw-r--r--hwtest/pgraph_class_celsius.cc360
-rw-r--r--hwtest/pgraph_class_emu_d3d56.cc61
-rw-r--r--hwtest/pgraph_state.cc23
-rw-r--r--hwtest/pgraph_state_tests.cc3
-rw-r--r--include/nvhw/pgraph.h4
5 files changed, 445 insertions, 6 deletions
diff --git a/hwtest/pgraph_class_celsius.cc b/hwtest/pgraph_class_celsius.cc
index a56cee51..cbf5b478 100644
--- a/hwtest/pgraph_class_celsius.cc
+++ b/hwtest/pgraph_class_celsius.cc
@@ -124,6 +124,9 @@ class MthdCelsiusTexOffset : public SingleMthdTest {
if (rnd() & 1) {
val ^= 1 << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & 0x7f);
@@ -133,6 +136,7 @@ class MthdCelsiusTexOffset : public SingleMthdTest {
exp.celsius_tex_offset[idx] = val;
exp.celsius_pipe_junk[0] = idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_offset[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], idx ? 22 : 14, 1, 1);
}
@@ -163,6 +167,9 @@ class MthdCelsiusTexFormat : public SingleMthdTest {
insrt(val, 12, 4, 1);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
int mips = extr(val, 12, 4);
@@ -225,6 +232,7 @@ class MthdCelsiusTexFormat : public SingleMthdTest {
exp.celsius_tex_format[idx] = rval | (exp.celsius_tex_format[idx] & 8);
exp.celsius_pipe_junk[0] = 0x10 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_format[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], idx ? 21 : 15, 1, 1);
}
@@ -232,6 +240,11 @@ class MthdCelsiusTexFormat : public SingleMthdTest {
};
class MthdCelsiusTexControl : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
bool is_valid_val() override {
if (extr(val, 31, 1))
return false;
@@ -245,6 +258,7 @@ class MthdCelsiusTexControl : public SingleMthdTest {
insrt(exp.celsius_xf_misc_b, idx ? 14 : 0, 1, extr(val, 30, 1));
exp.celsius_pipe_junk[0] = 0x18 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_control[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
if (!extr(exp.debug[3], 28, 1)) {
exp.celsius_pipe_junk[2] = exp.celsius_xf_misc_a;
exp.celsius_pipe_junk[3] = exp.celsius_xf_misc_b;
@@ -268,6 +282,9 @@ class MthdCelsiusTexPitch : public SingleMthdTest {
val ^= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & 0xffff) && !!(val & 0x3ff80000);
@@ -277,17 +294,24 @@ class MthdCelsiusTexPitch : public SingleMthdTest {
exp.celsius_tex_pitch[idx] = val & 0xffff0000;
exp.celsius_pipe_junk[0] = 0x20 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_pitch[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
};
class MthdCelsiusTexUnk238 : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
void emulate_mthd() override {
if (!extr(exp.nsource, 1, 1)) {
exp.celsius_tex_unk238[idx] = val;
exp.celsius_pipe_junk[0] = 0x28 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_unk238[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -313,6 +337,9 @@ class MthdCelsiusTexRect : public SingleMthdTest {
val |= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (extr(val, 16, 1))
@@ -328,6 +355,7 @@ class MthdCelsiusTexRect : public SingleMthdTest {
exp.celsius_tex_rect[idx] = val & 0x07ff07ff;
exp.celsius_pipe_junk[0] = 0x30 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_rect[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -349,6 +377,9 @@ class MthdCelsiusTexFilter : public SingleMthdTest {
val ^= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (extr(val, 13, 11))
@@ -364,6 +395,7 @@ class MthdCelsiusTexFilter : public SingleMthdTest {
exp.celsius_tex_filter[idx] = val & 0x77001fff;
exp.celsius_pipe_junk[0] = 0x38 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_filter[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], idx ? 23 : 16, 1, 1);
}
@@ -381,6 +413,9 @@ class MthdCelsiusTexPalette : public SingleMthdTest {
val |= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & 0x3e);
@@ -390,6 +425,7 @@ class MthdCelsiusTexPalette : public SingleMthdTest {
exp.celsius_tex_palette[idx] = val & 0xffffffc1;
exp.celsius_pipe_junk[0] = 8 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_palette[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -417,6 +453,9 @@ class MthdCelsiusRcInAlpha : public SingleMthdTest {
val |= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
for (int j = 0; j < 4; j++) {
@@ -431,6 +470,7 @@ class MthdCelsiusRcInAlpha : public SingleMthdTest {
exp.celsius_rc_in[0][idx] = val;
exp.celsius_pipe_junk[0] = 0x40 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_rc_in[0][idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -458,6 +498,9 @@ class MthdCelsiusRcInColor : public SingleMthdTest {
val |= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
for (int j = 0; j < 4; j++) {
@@ -472,17 +515,24 @@ class MthdCelsiusRcInColor : public SingleMthdTest {
exp.celsius_rc_in[1][idx] = val;
exp.celsius_pipe_junk[0] = 0x48 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_rc_in[1][idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
};
class MthdCelsiusRcFactor : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
void emulate_mthd() override {
if (!extr(exp.nsource, 1, 1)) {
exp.celsius_rc_factor[idx] = val;
exp.celsius_pipe_junk[0] = 0x50 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_rc_factor[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -516,6 +566,9 @@ class MthdCelsiusRcOutAlpha : public SingleMthdTest {
val |= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
int op = extr(val, 15, 3);
@@ -537,6 +590,7 @@ class MthdCelsiusRcOutAlpha : public SingleMthdTest {
exp.celsius_rc_out[0][idx] = val & 0x3cfff;
exp.celsius_pipe_junk[0] = 0x58 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_rc_out[0][idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -570,6 +624,9 @@ class MthdCelsiusRcOutColor : public SingleMthdTest {
val |= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
int op = extr(val, 15, 3);
@@ -605,6 +662,7 @@ class MthdCelsiusRcOutColor : public SingleMthdTest {
exp.celsius_rc_out[1][idx] = rval;
exp.celsius_pipe_junk[0] = 0x60 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_rc_out[1][idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -621,6 +679,9 @@ class MthdCelsiusRcFinal0 : public SingleMthdTest {
val |= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (val & 0xc0c0c0c0)
@@ -637,6 +698,7 @@ class MthdCelsiusRcFinal0 : public SingleMthdTest {
exp.celsius_rc_final[0] = val & 0x3f3f3f3f;
exp.celsius_pipe_junk[0] = 0x68;
exp.celsius_pipe_junk[1] = exp.celsius_rc_final[0];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -653,6 +715,9 @@ class MthdCelsiusRcFinal1 : public SingleMthdTest {
val |= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (val & 0xc0c0c01f)
@@ -669,6 +734,7 @@ class MthdCelsiusRcFinal1 : public SingleMthdTest {
exp.celsius_rc_final[1] = val & 0x3f3f3fe0;
exp.celsius_pipe_junk[0] = 0x6c;
exp.celsius_pipe_junk[1] = exp.celsius_rc_final[1];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -685,6 +751,9 @@ class MthdCelsiusConfig : public SingleMthdTest {
val |= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (val & 0xceeeeefe)
@@ -708,6 +777,7 @@ class MthdCelsiusConfig : public SingleMthdTest {
insrt(exp.celsius_raster, 29, 1, extr(val, 12, 1));
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -883,6 +953,9 @@ class MthdCelsiusFogEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -901,6 +974,7 @@ class MthdCelsiusFogEnable : public SingleMthdTest {
insrt(exp.celsius_xf_misc_b, 31, 1, val);
exp.celsius_pipe_junk[0] = 0x7c;
exp.celsius_pipe_junk[1] = exp.celsius_config_b;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
if (!extr(exp.debug[3], 28, 1)) {
exp.celsius_pipe_junk[2] = exp.celsius_xf_misc_a;
exp.celsius_pipe_junk[3] = exp.celsius_xf_misc_b;
@@ -915,6 +989,9 @@ class MthdCelsiusFogColor : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -930,6 +1007,7 @@ class MthdCelsiusFogColor : public SingleMthdTest {
insrt(exp.celsius_fog_color, 24, 8, extr(val, 24, 8));
exp.celsius_pipe_junk[0] = 0x8c;
exp.celsius_pipe_junk[1] = exp.celsius_fog_color;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
insrt(exp.valid[1], 13, 1, 1);
@@ -941,6 +1019,9 @@ class MthdCelsiusTexColorKey : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -953,6 +1034,7 @@ class MthdCelsiusTexColorKey : public SingleMthdTest {
exp.celsius_tex_color_key[idx] = val;
exp.celsius_pipe_junk[0] = 0xa0 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_color_key[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
if (idx == 0)
@@ -1058,6 +1140,9 @@ class MthdCelsiusAlphaFuncEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1075,6 +1160,7 @@ class MthdCelsiusAlphaFuncEnable : public SingleMthdTest {
insrt(exp.celsius_config_a, 12, 1, val);
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1097,6 +1183,9 @@ class MthdCelsiusBlendFuncEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1114,6 +1203,7 @@ class MthdCelsiusBlendFuncEnable : public SingleMthdTest {
insrt(exp.celsius_blend, 3, 1, val);
exp.celsius_pipe_junk[0] = 0x80;
exp.celsius_pipe_junk[1] = exp.celsius_blend;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1136,6 +1226,9 @@ class MthdCelsiusCullFaceEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1153,6 +1246,7 @@ class MthdCelsiusCullFaceEnable : public SingleMthdTest {
insrt(exp.celsius_raster, 28, 1, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1175,6 +1269,9 @@ class MthdCelsiusDepthTestEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1192,6 +1289,7 @@ class MthdCelsiusDepthTestEnable : public SingleMthdTest {
insrt(exp.celsius_config_a, 14, 1, val);
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1214,6 +1312,9 @@ class MthdCelsiusDitherEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1231,6 +1332,7 @@ class MthdCelsiusDitherEnable : public SingleMthdTest {
insrt(exp.celsius_config_a, 22, 1, val);
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1294,6 +1396,9 @@ class MthdCelsiusPointParamsEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1312,6 +1417,7 @@ class MthdCelsiusPointParamsEnable : public SingleMthdTest {
insrt(exp.celsius_xf_misc_a, 25, 1, val);
exp.celsius_pipe_junk[0] = 0x7c;
exp.celsius_pipe_junk[1] = exp.celsius_config_b;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
if (!extr(exp.debug[3], 28, 1)) {
exp.celsius_pipe_junk[2] = exp.celsius_xf_misc_a;
exp.celsius_pipe_junk[3] = exp.celsius_xf_misc_b;
@@ -1338,6 +1444,9 @@ class MthdCelsiusPointSmoothEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1355,6 +1464,7 @@ class MthdCelsiusPointSmoothEnable : public SingleMthdTest {
insrt(exp.celsius_raster, 9, 1, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1377,6 +1487,9 @@ class MthdCelsiusLineSmoothEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1394,6 +1507,7 @@ class MthdCelsiusLineSmoothEnable : public SingleMthdTest {
insrt(exp.celsius_raster, 10, 1, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1416,6 +1530,9 @@ class MthdCelsiusPolygonSmoothEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1433,6 +1550,7 @@ class MthdCelsiusPolygonSmoothEnable : public SingleMthdTest {
insrt(exp.celsius_raster, 11, 1, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1496,6 +1614,9 @@ class MthdCelsiusStencilEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1513,6 +1634,7 @@ class MthdCelsiusStencilEnable : public SingleMthdTest {
insrt(exp.celsius_stencil_func, 0, 1, val);
exp.celsius_pipe_junk[0] = 0x74;
exp.celsius_pipe_junk[1] = exp.celsius_stencil_func;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1535,6 +1657,9 @@ class MthdCelsiusPolygonOffsetPointEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1552,6 +1677,7 @@ class MthdCelsiusPolygonOffsetPointEnable : public SingleMthdTest {
insrt(exp.celsius_raster, 6, 1, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1574,6 +1700,9 @@ class MthdCelsiusPolygonOffsetLineEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1591,6 +1720,7 @@ class MthdCelsiusPolygonOffsetLineEnable : public SingleMthdTest {
insrt(exp.celsius_raster, 7, 1, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1613,6 +1743,9 @@ class MthdCelsiusPolygonOffsetFillEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1630,6 +1763,7 @@ class MthdCelsiusPolygonOffsetFillEnable : public SingleMthdTest {
insrt(exp.celsius_raster, 8, 1, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1655,6 +1789,9 @@ class MthdCelsiusAlphaFuncFunc : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1674,6 +1811,7 @@ class MthdCelsiusAlphaFuncFunc : public SingleMthdTest {
insrt(exp.celsius_config_a, 8, 4, val);
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1696,6 +1834,9 @@ class MthdCelsiusAlphaFuncRef : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1713,6 +1854,7 @@ class MthdCelsiusAlphaFuncRef : public SingleMthdTest {
insrt(exp.celsius_config_a, 0, 8, val);
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1739,6 +1881,9 @@ class MthdCelsiusBlendFunc : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1805,6 +1950,7 @@ class MthdCelsiusBlendFunc : public SingleMthdTest {
insrt(exp.celsius_blend, 4 + which * 4, 4, rv);
exp.celsius_pipe_junk[0] = 0x80;
exp.celsius_pipe_junk[1] = exp.celsius_blend;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1817,6 +1963,9 @@ class MthdCelsiusBlendColor : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1829,6 +1978,7 @@ class MthdCelsiusBlendColor : public SingleMthdTest {
exp.celsius_blend_color = val;
exp.celsius_pipe_junk[0] = 0x84;
exp.celsius_pipe_junk[1] = exp.celsius_blend_color;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1854,6 +2004,9 @@ class MthdCelsiusBlendEquation : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1890,6 +2043,7 @@ class MthdCelsiusBlendEquation : public SingleMthdTest {
insrt(exp.celsius_blend, 0, 3, rv);
exp.celsius_pipe_junk[0] = 0x80;
exp.celsius_pipe_junk[1] = exp.celsius_blend;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1915,6 +2069,9 @@ class MthdCelsiusDepthFunc : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1934,6 +2091,7 @@ class MthdCelsiusDepthFunc : public SingleMthdTest {
insrt(exp.celsius_config_a, 16, 4, val);
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1953,6 +2111,9 @@ class MthdCelsiusColorMask : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -1973,6 +2134,7 @@ class MthdCelsiusColorMask : public SingleMthdTest {
insrt(exp.celsius_config_a, 26, 1, extr(val, 24, 1));
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -1995,6 +2157,9 @@ class MthdCelsiusDepthWriteEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2012,6 +2177,7 @@ class MthdCelsiusDepthWriteEnable : public SingleMthdTest {
insrt(exp.celsius_config_a, 24, 1, val);
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2035,6 +2201,9 @@ class MthdCelsiusStencilVal : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2052,6 +2221,7 @@ class MthdCelsiusStencilVal : public SingleMthdTest {
insrt(exp.celsius_stencil_func, 8 + 8 * which, 8, val);
exp.celsius_pipe_junk[0] = 0x74;
exp.celsius_pipe_junk[1] = exp.celsius_stencil_func;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2079,6 +2249,9 @@ class MthdCelsiusStencilFunc : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2098,6 +2271,7 @@ class MthdCelsiusStencilFunc : public SingleMthdTest {
insrt(exp.celsius_stencil_func, 4, 4, val);
exp.celsius_pipe_junk[0] = 0x74;
exp.celsius_pipe_junk[1] = exp.celsius_stencil_func;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2128,6 +2302,9 @@ class MthdCelsiusStencilOp : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2172,6 +2349,7 @@ class MthdCelsiusStencilOp : public SingleMthdTest {
insrt(exp.celsius_stencil_op, 4 * which, 4, rv);
exp.celsius_pipe_junk[0] = 0x78;
exp.celsius_pipe_junk[1] = exp.celsius_stencil_op;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2203,6 +2381,9 @@ class MthdCelsiusShadeMode : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2226,6 +2407,7 @@ class MthdCelsiusShadeMode : public SingleMthdTest {
insrt(exp.celsius_config_b, 7, 1, val);
exp.celsius_pipe_junk[0] = 0x7c;
exp.celsius_pipe_junk[1] = exp.celsius_config_b;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2237,6 +2419,9 @@ class MthdCelsiusLineWidth : public SingleMthdTest {
val = sext(val, rnd() & 0x1f);
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2257,6 +2442,7 @@ class MthdCelsiusLineWidth : public SingleMthdTest {
insrt(exp.celsius_raster, 12, 9, rv);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2267,6 +2453,9 @@ class MthdCelsiusPolygonOffsetFactor : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2282,6 +2471,7 @@ class MthdCelsiusPolygonOffsetFactor : public SingleMthdTest {
exp.celsius_polygon_offset_factor = val;
exp.celsius_pipe_junk[0] = 0x90;
exp.celsius_pipe_junk[1] = exp.celsius_polygon_offset_factor;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2292,6 +2482,9 @@ class MthdCelsiusPolygonOffsetUnits : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2307,6 +2500,7 @@ class MthdCelsiusPolygonOffsetUnits : public SingleMthdTest {
exp.celsius_polygon_offset_units = val;
exp.celsius_pipe_junk[0] = 0x94;
exp.celsius_pipe_junk[1] = exp.celsius_polygon_offset_units;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2337,6 +2531,9 @@ class MthdCelsiusPolygonMode : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2366,6 +2563,7 @@ class MthdCelsiusPolygonMode : public SingleMthdTest {
insrt(exp.celsius_raster, which * 2, 2, rv);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2378,6 +2576,9 @@ class MthdCelsiusDepthRangeNear : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2393,6 +2594,7 @@ class MthdCelsiusDepthRangeNear : public SingleMthdTest {
exp.celsius_depth_range_near = val;
exp.celsius_pipe_junk[0] = 0x98;
exp.celsius_pipe_junk[1] = exp.celsius_depth_range_near;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2403,6 +2605,9 @@ class MthdCelsiusDepthRangeFar : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2418,6 +2623,7 @@ class MthdCelsiusDepthRangeFar : public SingleMthdTest {
exp.celsius_depth_range_far = val;
exp.celsius_pipe_junk[0] = 0x9c;
exp.celsius_pipe_junk[1] = exp.celsius_depth_range_far;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2447,6 +2653,9 @@ class MthdCelsiusCullFace : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2476,6 +2685,7 @@ class MthdCelsiusCullFace : public SingleMthdTest {
insrt(exp.celsius_raster, 21, 2, rv);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2505,6 +2715,9 @@ class MthdCelsiusFrontFace : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2528,6 +2741,7 @@ class MthdCelsiusFrontFace : public SingleMthdTest {
insrt(exp.celsius_raster, 23, 1, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2591,6 +2805,9 @@ class MthdCelsiusSpecularEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2608,6 +2825,7 @@ class MthdCelsiusSpecularEnable : public SingleMthdTest {
insrt(exp.celsius_config_b, 5, 1, val);
exp.celsius_pipe_junk[0] = 0x7c;
exp.celsius_pipe_junk[1] = exp.celsius_config_b;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2832,6 +3050,9 @@ class MthdCelsiusPointSize : public SingleMthdTest {
val = sext(val, rnd() & 0x1f);
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -2849,6 +3070,7 @@ class MthdCelsiusPointSize : public SingleMthdTest {
exp.celsius_point_size = val & 0x1ff;
exp.celsius_pipe_junk[0] = 0xa8;
exp.celsius_pipe_junk[1] = exp.celsius_point_size;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2868,6 +3090,9 @@ class MthdCelsiusUnk3f0 : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return val < 4;
@@ -2886,6 +3111,7 @@ class MthdCelsiusUnk3f0 : public SingleMthdTest {
insrt(exp.celsius_raster, 26, 2, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -2905,6 +3131,9 @@ class MthdCelsiusUnk3f4 : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return val < 2;
@@ -2923,6 +3152,7 @@ class MthdCelsiusUnk3f4 : public SingleMthdTest {
insrt(exp.celsius_config_b, 0, 1, val);
exp.celsius_pipe_junk[0] = 0x7c;
exp.celsius_pipe_junk[1] = exp.celsius_config_b;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -3357,6 +3587,47 @@ public:
: SingleMthdTest(opt, seed, name, trapbit, cls, mthd, num, stride), which(which) {}
};
+class MthdCelsiusEdgeFlag : public SingleMthdTest {
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1)) {
+ exp.celsius_pipe_edge_flag = val & 1;
+ }
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdCelsiusBeginEnd : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xf;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ if (rnd() & 1)
+ insrt(orig.notify, 28, 3, 0);
+ if (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
+ bool can_warn() override {
+ return true;
+ }
+ void emulate_mthd() override {
+ uint32_t err = 0;
+ if (val > 0xa)
+ err |= 1;
+ if (extr(exp.celsius_config_c, 8, 1) && (val & 0xf) != 0)
+ err |= 4;
+ warn(err);
+ if (!err && !extr(exp.nsource, 1, 1)) {
+ exp.celsius_pipe_begin_end = val & 0xf;
+ insrt(exp.celsius_config_c, 8, 1, (val & 0xf) != 0);
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
class MthdCelsiusOldUnk3f8 : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1) {
@@ -3370,6 +3641,9 @@ class MthdCelsiusOldUnk3f8 : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -3387,6 +3661,7 @@ class MthdCelsiusOldUnk3f8 : public SingleMthdTest {
insrt(exp.celsius_raster, 30, 2, val);
exp.celsius_pipe_junk[0] = 0x88;
exp.celsius_pipe_junk[1] = exp.celsius_raster;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -3406,6 +3681,9 @@ class MthdCelsiusColorLogicOpEnable : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -3423,6 +3701,7 @@ class MthdCelsiusColorLogicOpEnable : public SingleMthdTest {
insrt(exp.celsius_blend, 16, 1, val);
exp.celsius_pipe_junk[0] = 0x80;
exp.celsius_pipe_junk[1] = exp.celsius_blend;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -3448,6 +3727,9 @@ class MthdCelsiusColorLogicOpOp : public SingleMthdTest {
}
if (rnd() & 1)
insrt(orig.notify, 28, 3, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool can_warn() override {
return true;
@@ -3467,6 +3749,7 @@ class MthdCelsiusColorLogicOpOp : public SingleMthdTest {
insrt(exp.celsius_blend, 12, 4, val);
exp.celsius_pipe_junk[0] = 0x80;
exp.celsius_pipe_junk[1] = exp.celsius_blend;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
}
@@ -3474,6 +3757,11 @@ class MthdCelsiusColorLogicOpOp : public SingleMthdTest {
};
class MthdDmaClipid : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
bool takes_dma() override { return true; }
void emulate_mthd() override {
uint32_t offset_mask = pgraph_offset_mask(&chipset) | 0xf;
@@ -3484,6 +3772,7 @@ class MthdDmaClipid : public SingleMthdTest {
exp.celsius_surf_base_clipid = base & offset_mask;
exp.celsius_pipe_junk[0] = 0xc8;
exp.celsius_pipe_junk[1] = exp.celsius_surf_limit_clipid;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
bool bad = true;
if (dcls == 0x30 || dcls == 0x3d)
bad = false;
@@ -3507,6 +3796,11 @@ class MthdDmaClipid : public SingleMthdTest {
};
class MthdDmaZcull : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
bool takes_dma() override { return true; }
void emulate_mthd() override {
uint32_t offset_mask = 0x3fffffff;
@@ -3517,6 +3811,7 @@ class MthdDmaZcull : public SingleMthdTest {
exp.celsius_surf_base_zcull = base & offset_mask;
exp.celsius_pipe_junk[0] = 0xb8;
exp.celsius_pipe_junk[1] = exp.celsius_surf_limit_zcull;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
bool bad = true;
if (dcls == 0x30 || dcls == 0x3d)
bad = false;
@@ -3548,6 +3843,9 @@ class MthdSurfPitchClipid : public SingleMthdTest {
if (!(rnd() & 3)) {
val = (rnd() & 1) << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & ~0xff80) && !!val;
@@ -3557,6 +3855,7 @@ class MthdSurfPitchClipid : public SingleMthdTest {
exp.celsius_surf_pitch_clipid = val & 0xffff;
exp.celsius_pipe_junk[0] = 0xd0;
exp.celsius_pipe_junk[1] = exp.celsius_surf_pitch_clipid;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -3571,6 +3870,9 @@ class MthdSurfOffsetClipid : public SingleMthdTest {
if (!(rnd() & 3)) {
val = (rnd() & 1) << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & ~0xffffffc0);
@@ -3580,6 +3882,7 @@ class MthdSurfOffsetClipid : public SingleMthdTest {
exp.celsius_surf_offset_clipid = val & 0x07ffffff;
exp.celsius_pipe_junk[0] = 0xcc;
exp.celsius_pipe_junk[1] = exp.celsius_surf_offset_clipid;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -3594,6 +3897,9 @@ class MthdSurfPitchZcull : public SingleMthdTest {
if (!(rnd() & 3)) {
val = (rnd() & 1) << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & ~0xff80) && !!val;
@@ -3603,6 +3909,7 @@ class MthdSurfPitchZcull : public SingleMthdTest {
exp.celsius_surf_pitch_zcull = val & 0xffff;
exp.celsius_pipe_junk[0] = 0xc0;
exp.celsius_pipe_junk[1] = exp.celsius_surf_pitch_zcull;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -3617,6 +3924,9 @@ class MthdSurfOffsetZcull : public SingleMthdTest {
if (!(rnd() & 3)) {
val = (rnd() & 1) << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & ~0xffffffc0);
@@ -3626,6 +3936,7 @@ class MthdSurfOffsetZcull : public SingleMthdTest {
exp.celsius_surf_offset_zcull = val & 0x3fffffff;
exp.celsius_pipe_junk[0] = 0xbc;
exp.celsius_pipe_junk[1] = exp.celsius_surf_offset_zcull;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -3638,6 +3949,9 @@ class MthdInvalidateZcull : public SingleMthdTest {
if (rnd() & 1)
val ^= 1 << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return val < 4 || val == 6;
@@ -3661,6 +3975,11 @@ class MthdInvalidateZcull : public SingleMthdTest {
};
class MthdClearZeta : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
bool is_valid_val() override {
return !extr(exp.celsius_config_c, 8, 1);
}
@@ -3669,6 +3988,7 @@ class MthdClearZeta : public SingleMthdTest {
exp.celsius_clear_zeta = val;
exp.celsius_pipe_junk[0] = 0xdc;
exp.celsius_pipe_junk[1] = exp.celsius_clear_zeta;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -3681,6 +4001,9 @@ class MthdClipidEnable : public SingleMthdTest {
if (rnd() & 1)
val ^= 1 << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return val < 2 && !extr(exp.celsius_config_c, 8, 1);
@@ -3690,6 +4013,7 @@ class MthdClipidEnable : public SingleMthdTest {
insrt(exp.celsius_config_d, 6, 1, val);
exp.celsius_pipe_junk[0] = 0xd8;
exp.celsius_pipe_junk[1] = exp.celsius_config_d;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -3702,6 +4026,9 @@ class MthdClipidId : public SingleMthdTest {
if (rnd() & 1)
val ^= 1 << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & ~0xf) && !extr(exp.celsius_config_c, 8, 1);
@@ -3711,6 +4038,7 @@ class MthdClipidId : public SingleMthdTest {
exp.celsius_clipid_id = val & 0xf;
exp.celsius_pipe_junk[0] = 0xd4;
exp.celsius_pipe_junk[1] = exp.celsius_clipid_id;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -3728,6 +4056,9 @@ class MthdClearHv : public SingleMthdTest {
if (rnd() & 1)
val ^= 1 << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & ~0x0fff0fff) && !extr(exp.celsius_config_c, 8, 1) &&
@@ -3738,6 +4069,7 @@ class MthdClearHv : public SingleMthdTest {
exp.celsius_clear_hv[which] = val & 0x0fff0fff;
exp.celsius_pipe_junk[0] = 0xac + which * 4;
exp.celsius_pipe_junk[1] = exp.celsius_clear_hv[which];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
public:
@@ -3752,6 +4084,9 @@ class MthdCelsiusUnkd84 : public SingleMthdTest {
if (rnd() & 1)
val ^= 1 << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return !(val & ~0x80000003) && !extr(exp.celsius_config_c, 8, 1);
@@ -3762,6 +4097,7 @@ class MthdCelsiusUnkd84 : public SingleMthdTest {
insrt(exp.celsius_config_d, 31, 1, extr(val, 31, 1));
exp.celsius_pipe_junk[0] = 0xd8;
exp.celsius_pipe_junk[1] = exp.celsius_config_d;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -3774,6 +4110,9 @@ class MthdCelsiusTexUnk258 : public SingleMthdTest {
if (rnd() & 1)
val ^= 1 << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return val < 2;
@@ -3783,6 +4122,7 @@ class MthdCelsiusTexUnk258 : public SingleMthdTest {
insrt(exp.celsius_tex_format[idx], 3, 1, val);
exp.celsius_pipe_junk[0] = 0x10 + idx * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_format[idx];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -3837,6 +4177,9 @@ class MthdCelsiusUnk3f8 : public SingleMthdTest {
if (rnd() & 1)
val ^= 1 << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return val < 2;
@@ -3846,17 +4189,24 @@ class MthdCelsiusUnk3f8 : public SingleMthdTest {
insrt(exp.celsius_config_a, 31, 1, val);
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
};
class MthdCelsiusUnk3fc : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
void emulate_mthd() override {
if (!extr(exp.nsource, 1, 1)) {
exp.celsius_mthd_unk3fc = val;
exp.celsius_pipe_junk[0] = 0xe0;
exp.celsius_pipe_junk[1] = exp.celsius_mthd_unk3fc;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -4111,16 +4461,16 @@ std::vector<SingleMthdTest *> Celsius::mthds() {
new MthdCelsiusVtxAttrShort(opt, rnd(), "vtx_txc1_4s", -1, cls, 0xcd8, 2, 4, 4),
new MthdCelsiusVtxAttrFloat(opt, rnd(), "vtx_fog_1f", -1, cls, 0xce0, 1, 4, 7),
new MthdCelsiusVtxAttrFloat(opt, rnd(), "vtx_wei_1f", -1, cls, 0xce4, 1, 4, 6),
- new UntestedMthd(opt, rnd(), "vtx_edge_flag", -1, cls, 0xcec, 1), // XXX
+ new MthdCelsiusEdgeFlag(opt, rnd(), "vtx_edge_flag", -1, cls, 0xcec),
new UntestedMthd(opt, rnd(), "meh", -1, cls, 0xcf0, 4), // XXX
new UntestedMthd(opt, rnd(), "meh", -1, cls, 0xd00, 0x10), // XXX
- new UntestedMthd(opt, rnd(), "draw_idx16.begin", -1, cls, 0xdfc), // XXX
+ new MthdCelsiusBeginEnd(opt, rnd(), "draw_idx16.begin", -1, cls, 0xdfc),
new UntestedMthd(opt, rnd(), "draw_idx16.data", -1, cls, 0xe00, 0x80), // XXX
- new UntestedMthd(opt, rnd(), "draw_idx32.begin", -1, cls, 0x10fc), // XXX
+ new MthdCelsiusBeginEnd(opt, rnd(), "draw_idx32.begin", -1, cls, 0x10fc),
new UntestedMthd(opt, rnd(), "draw_idx32.data", -1, cls, 0x1100, 0x40), // XXX
- new UntestedMthd(opt, rnd(), "draw_arrays.begin", -1, cls, 0x13fc), // XXX
+ new MthdCelsiusBeginEnd(opt, rnd(), "draw_arrays.begin", -1, cls, 0x13fc),
new UntestedMthd(opt, rnd(), "draw_arrays.data", -1, cls, 0x1400, 0x80), // XXX
- new UntestedMthd(opt, rnd(), "draw_inline.begin", -1, cls, 0x17fc), // XXX
+ new MthdCelsiusBeginEnd(opt, rnd(), "draw_inline.begin", -1, cls, 0x17fc),
new UntestedMthd(opt, rnd(), "draw_inline.data", -1, cls, 0x1800, 0x200), // XXX
};
if (cls == 0x56) {
diff --git a/hwtest/pgraph_class_emu_d3d56.cc b/hwtest/pgraph_class_emu_d3d56.cc
index b1f63c15..67f20a1e 100644
--- a/hwtest/pgraph_class_emu_d3d56.cc
+++ b/hwtest/pgraph_class_emu_d3d56.cc
@@ -31,11 +31,17 @@ namespace hwtest {
namespace pgraph {
class MthdEmuD3D56TexColorKey : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
void emulate_mthd() override {
if (!extr(exp.nsource, 1, 1)) {
exp.celsius_tex_color_key[0] = val;
exp.celsius_pipe_junk[0] = 0xa0;
exp.celsius_pipe_junk[1] = val;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], 12, 1, 1);
}
@@ -49,6 +55,9 @@ class MthdEmuD3D56TexOffset : public SingleMthdTest {
val &= ~0xff;
val ^= 1 << (rnd() & 0x1f);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
return (val & 0xff) == 0 || cls == 0x48;
@@ -60,6 +69,7 @@ class MthdEmuD3D56TexOffset : public SingleMthdTest {
exp.celsius_tex_offset[j] = val;
exp.celsius_pipe_junk[0] = j * 4;
exp.celsius_pipe_junk[1] = val;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], j ? 22 : 14, 1, 1);
}
@@ -92,6 +102,9 @@ class MthdEmuD3D56TexFormat : public SingleMthdTest {
if (rnd() & 3)
insrt(val, 28, 3, 1);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (!extr(val, 0, 2) || extr(val, 0, 2) == 3)
@@ -173,6 +186,7 @@ class MthdEmuD3D56TexFormat : public SingleMthdTest {
exp.celsius_tex_format[i] = rval | (exp.celsius_tex_format[i] & 8);
exp.celsius_pipe_junk[0] = 0x10 + i * 4;
exp.celsius_pipe_junk[1] = exp.celsius_tex_format[i];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
if (cls == 0x94 || cls == 0x54) {
@@ -184,6 +198,7 @@ class MthdEmuD3D56TexFormat : public SingleMthdTest {
insrt(exp.celsius_xf_misc_b, 16, 1, 0);
exp.celsius_pipe_junk[0] = 0x1c;
exp.celsius_pipe_junk[1] = exp.celsius_tex_control[1];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
} else {
if (which == 2) {
insrt(exp.celsius_xf_misc_b, 16, 1,
@@ -219,6 +234,9 @@ class MthdEmuD3D56TexFilter : public SingleMthdTest {
if (rnd() & 3)
insrt(val, 13, 2, 0);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (extr(val, 13, 2))
@@ -243,6 +261,7 @@ class MthdEmuD3D56TexFilter : public SingleMthdTest {
exp.celsius_tex_filter[which == 2] = rval;
exp.celsius_pipe_junk[0] = 0x38 + (which == 2) * 4;
exp.celsius_pipe_junk[1] = rval;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], which == 2 ? 23 : 16, 1, 1);
}
@@ -273,6 +292,9 @@ class MthdEmuD3D6CombineControl : public SingleMthdTest {
val ^= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (val & 0x00e0e0e0)
@@ -372,6 +394,7 @@ class MthdEmuD3D6CombineControl : public SingleMthdTest {
if (extr(cc, 22, 1) || (extr(cc, 18, 1) && extr(cc, 20, 1)))
insrt(jval, 13, 1, 1);
exp.celsius_pipe_junk[1] = jval;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
public:
@@ -380,12 +403,18 @@ public:
};
class MthdEmuD3D6CombineFactor : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
void emulate_mthd() override {
if (!extr(exp.nsource, 1, 1)) {
exp.celsius_rc_factor[0] = val;
exp.celsius_rc_factor[1] = val;
exp.celsius_pipe_junk[0] = 0x54;
exp.celsius_pipe_junk[1] = val;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], 24, 1, 1);
}
@@ -406,6 +435,9 @@ class MthdEmuD3D56Blend : public SingleMthdTest {
if (rnd() & 1)
insrt(val, 0, 4, 0);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (cls == 0x54 || cls == 0x94) {
@@ -508,6 +540,7 @@ class MthdEmuD3D56Blend : public SingleMthdTest {
exp.celsius_pipe_junk[1] = exp.celsius_blend;
exp.celsius_pipe_junk[2] = exp.celsius_xf_misc_a;
exp.celsius_pipe_junk[3] = exp.celsius_xf_misc_b;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], 19, 1, 1);
}
@@ -526,6 +559,9 @@ class MthdEmuD3D56Config : public SingleMthdTest {
if (rnd() & 3)
insrt(val, 25, 5, 0);
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (extr(val, 8, 4) < 1 || extr(val, 8, 4) > 8)
@@ -568,6 +604,7 @@ class MthdEmuD3D56Config : public SingleMthdTest {
exp.celsius_pipe_junk[1] = exp.celsius_raster;
exp.celsius_pipe_junk[2] = exp.celsius_xf_misc_a;
exp.celsius_pipe_junk[3] = exp.celsius_xf_misc_b;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], 17, 1, 1);
if (!is_d3d6)
@@ -580,6 +617,9 @@ class MthdEmuD3D6StencilFunc : public SingleMthdTest {
void adjust_orig_mthd() override {
if (rnd() & 1)
val &= ~0xe;
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (extr(val, 1, 3))
@@ -596,6 +636,7 @@ class MthdEmuD3D6StencilFunc : public SingleMthdTest {
exp.celsius_stencil_func = rval;
exp.celsius_pipe_junk[0] = 0x74;
exp.celsius_pipe_junk[1] = exp.celsius_stencil_func;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -612,6 +653,9 @@ class MthdEmuD3D6StencilOp : public SingleMthdTest {
val ^= 1 << (rnd() & 0x1f);
}
}
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
bool is_valid_val() override {
if (extr(val, 0, 4) < 1 || extr(val, 0, 4) > 8)
@@ -630,18 +674,25 @@ class MthdEmuD3D6StencilOp : public SingleMthdTest {
exp.celsius_stencil_op = val & 0xfff;
exp.celsius_pipe_junk[0] = 0x78;
exp.celsius_pipe_junk[1] = exp.celsius_stencil_op;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
};
class MthdEmuD3D56FogColor : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
void emulate_mthd() override {
insrt(exp.valid[1], 13, 1, 1);
if (!extr(exp.nsource, 1, 1)) {
exp.celsius_fog_color = val;
exp.celsius_pipe_junk[0] = 0x8c;
exp.celsius_pipe_junk[1] = val;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -696,6 +747,7 @@ class MthdEmuEmuD3D0TexFormat : public SingleMthdTest {
exp.celsius_tex_control[1] = 0x3ffc0 | extr(val, 16, 2);
exp.celsius_pipe_junk[0] = 0x1c;
exp.celsius_pipe_junk[1] = exp.celsius_tex_control[1];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
}
using SingleMthdTest::SingleMthdTest;
@@ -708,6 +760,7 @@ class MthdEmuEmuD3D0TexFilter : public SingleMthdTest {
insrt(exp.celsius_tex_filter[1], 0, 13, extrs(val, 16, 8) << 4);
exp.celsius_pipe_junk[0] = 0x3c;
exp.celsius_pipe_junk[1] = exp.celsius_tex_filter[1];
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], 23, 1, 1);
insrt(exp.valid[1], 16, 1, 1);
@@ -822,6 +875,7 @@ class MthdEmuEmuD3D0Config : public SingleMthdTest {
exp.celsius_pipe_junk[1] = exp.celsius_raster;
exp.celsius_pipe_junk[2] = exp.celsius_xf_misc_a;
exp.celsius_pipe_junk[3] = exp.celsius_xf_misc_b;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], 17, 1, 1);
insrt(exp.valid[1], 24, 1, 1);
@@ -857,6 +911,7 @@ class MthdEmuEmuD3D0Alpha : public SingleMthdTest {
insrt(exp.celsius_config_a, 12, 1, 1);
exp.celsius_pipe_junk[0] = 0x70;
exp.celsius_pipe_junk[1] = exp.celsius_config_a;
+ insrt(exp.celsius_pipe_vtx_state, 28, 3, 0);
}
insrt(exp.valid[1], 18, 1, 1);
}
@@ -1021,8 +1076,12 @@ class MthdEmuD3D56TlvUv : public SingleMthdTest {
int which_uv, which_vtx;
bool fin;
void adjust_orig_mthd() override {
- if (fin)
+ if (fin) {
insrt(orig.notify, 0, 1, 0);
+ if (nv04_pgraph_is_nv17p(&chipset) && (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa)) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
+ }
if (cls == 0x48 && fin) {
// XXX: test me
exp.valid[0] = 0;
diff --git a/hwtest/pgraph_state.cc b/hwtest/pgraph_state.cc
index b69856ef..4d27a21b 100644
--- a/hwtest/pgraph_state.cc
+++ b/hwtest/pgraph_state.cc
@@ -430,6 +430,7 @@ class CelsiusRegister : public MmioRegister {
}
state->celsius_pipe_junk[0] = addr & 0xfc;
state->celsius_pipe_junk[1] = rval;
+ insrt(state->celsius_pipe_vtx_state, 28, 3, 0);
}
using MmioRegister::MmioRegister;
};
@@ -439,6 +440,7 @@ class SimpleCelsiusRegister : public SimpleMmioRegister {
MmioRegister::sim_write(state, val);
state->celsius_pipe_junk[0] = addr & 0xfc;
state->celsius_pipe_junk[1] = ref(state);
+ insrt(state->celsius_pipe_vtx_state, 28, 3, 0);
}
using SimpleMmioRegister::SimpleMmioRegister;
};
@@ -463,6 +465,7 @@ class IndexedCelsiusRegister : public IndexedMmioRegister<n> {
}
state->celsius_pipe_junk[0] = ad & 0xfc;
state->celsius_pipe_junk[1] = rval;
+ insrt(state->celsius_pipe_vtx_state, 28, 3, 0);
}
using IndexedMmioRegister<n>::IndexedMmioRegister;
};
@@ -862,6 +865,10 @@ static uint32_t canonical_light_sx_float(uint32_t v) {
void pgraph_gen_state_celsius(int cnum, std::mt19937 &rnd, struct pgraph_state *state) {
for (auto &reg : pgraph_celsius_regs(state->chipset)) {
reg->ref(state) = (rnd() & reg->mask) | reg->fixed;
+ state->celsius_pipe_begin_end = rnd() & 0xf;
+ state->celsius_pipe_edge_flag = rnd() & 0x1;
+ state->celsius_pipe_unk48 = 0;
+ state->celsius_pipe_vtx_state = rnd() & 0x70001f3f;
for (int i = 0; i < 0x1c; i++)
state->celsius_pipe_vtx[i] = rnd();
for (int i = 0; i < 4; i++)
@@ -1087,6 +1094,12 @@ void pgraph_load_celsius(int cnum, struct pgraph_state *state) {
for (auto &reg : pgraph_celsius_regs(state->chipset)) {
reg->write(cnum, reg->ref(state));
}
+ uint32_t vtx[4];
+ vtx[0] = state->celsius_pipe_begin_end;
+ vtx[1] = state->celsius_pipe_edge_flag;
+ vtx[2] = state->celsius_pipe_unk48;
+ vtx[3] = state->celsius_pipe_vtx_state;
+ pgraph_load_pipe(cnum, 0x0040, vtx, 4);
pgraph_load_pipe(cnum, 0x4400, state->celsius_pipe_vtx, 0x1c);
for (int i = 0; i < 0x3c; i++) {
pgraph_load_pipe(cnum, 0x6400 + i * 0x10, state->celsius_pipe_xfrm[i], 4);
@@ -1399,6 +1412,12 @@ void pgraph_dump_celsius_pipe(int cnum, struct pgraph_state *state) {
for (int i = 0; i < 12; i++) {
pgraph_dump_pipe(cnum, 0x7800 + i * 0x10, state->celsius_pipe_light_sd + i, 1);
}
+ uint32_t vtx[4];
+ pgraph_dump_pipe(cnum, 0x0040, vtx, 4);
+ state->celsius_pipe_begin_end = vtx[0];
+ state->celsius_pipe_edge_flag = vtx[1];
+ state->celsius_pipe_unk48 = vtx[2];
+ state->celsius_pipe_vtx_state = vtx[3];
}
void pgraph_dump_debug(int cnum, struct pgraph_state *state) {
@@ -1700,6 +1719,10 @@ restart:
broke = true;
}
}
+ CMP(celsius_pipe_begin_end, "CELSIUS_PIPE_BEGIN_END")
+ CMP(celsius_pipe_edge_flag, "CELSIUS_PIPE_EDGE_FLAG")
+ CMP(celsius_pipe_unk48, "CELSIUS_PIPE_UNK48")
+ CMP(celsius_pipe_vtx_state, "CELSIUS_PIPE_VTX_STATE")
for (int i = 0; i < 0x1c; i++)
CMP(celsius_pipe_vtx[i], "CELSIUS_PIPE_VTX[%d]", i)
for (int i = 0; i < 4; i++)
diff --git a/hwtest/pgraph_state_tests.cc b/hwtest/pgraph_state_tests.cc
index 847b4a2f..9afd18e9 100644
--- a/hwtest/pgraph_state_tests.cc
+++ b/hwtest/pgraph_state_tests.cc
@@ -699,6 +699,9 @@ protected:
if (cls == 0x37 || cls == 0x77 || cls == 0x63 || cls == 0x67 || cls == 0x89 || cls == 0x87 || cls == 0x38 || cls == 0x88 || cls == 0x60 || cls == 0x64)
orig.ctx_switch[0] ^= 0x80;
}
+ if (orig.celsius_pipe_begin_end == 3 || orig.celsius_pipe_begin_end == 0xa) {
+ insrt(orig.celsius_pipe_vtx_state, 28, 3, 0);
+ }
}
void mutate() override {
val = rnd();
diff --git a/include/nvhw/pgraph.h b/include/nvhw/pgraph.h
index 4938869f..03618aef 100644
--- a/include/nvhw/pgraph.h
+++ b/include/nvhw/pgraph.h
@@ -227,6 +227,10 @@ struct pgraph_state {
uint32_t celsius_pipe_light_sc[12];
uint32_t celsius_pipe_light_sd[12];
uint32_t celsius_pipe_junk[4];
+ uint32_t celsius_pipe_begin_end;
+ uint32_t celsius_pipe_edge_flag;
+ uint32_t celsius_pipe_unk48;
+ uint32_t celsius_pipe_vtx_state;
};
enum {