summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-07-21 08:26:01 -0600
committerBrian Paul <brianp@vmware.com>2010-07-21 08:26:01 -0600
commit9df55aed6ef0aac82f5008e6ab1ffa2842aaa7fe (patch)
tree960c65e2ced7c689bda2c98ea14214be901f0b17
parent63f99d4e874fce31271eedf53d01c1f98a4b17e6 (diff)
fragProg1: add a few more tests (DP3, ADD w/ immediates)
-rw-r--r--src/glean/tfragprog1.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/glean/tfragprog1.cpp b/src/glean/tfragprog1.cpp
index 17aeb6a..b3fe1d4 100644
--- a/src/glean/tfragprog1.cpp
+++ b/src/glean/tfragprog1.cpp
@@ -133,6 +133,53 @@ static const FragmentProgram Programs[] = {
},
DONT_CARE_Z
},
+
+ {
+ "ADD an immediate",
+ "!!ARBfp1.0\n"
+ "PARAM p = program.local[1]; \n"
+ "ADD result.color, p, {0.25, 0.0, 0.5, 0.25}; \n"
+ "END \n",
+ { CLAMP01(Param1[0] + 0.25),
+ CLAMP01(Param1[1] + 0.0),
+ CLAMP01(Param1[2] + 0.5),
+ CLAMP01(Param1[3] + 0.25),
+ },
+ DONT_CARE_Z
+ },
+
+ {
+ "ADD negative immediate",
+ "!!ARBfp1.0\n"
+ "PARAM p = program.local[1]; \n"
+ "ADD result.color, p, {-0.25, -0.2, 0.0, -0.25}; \n"
+ "END \n",
+ { CLAMP01(Param1[0] - 0.25),
+ CLAMP01(Param1[1] - 0.2),
+ CLAMP01(Param1[2] - 0.0),
+ CLAMP01(Param1[3] - 0.25),
+ },
+ DONT_CARE_Z
+ },
+
+ {
+ "ADD negative immediate (2)",
+ "!!ARBfp1.0\n"
+ "PARAM p = program.local[1]; \n"
+ "TEMP t; \n"
+ "MOV t, p; \n"
+ "MUL t.xyz, t, 2.0; \n"
+ "ADD t.xyz, t, -1.0; \n"
+ "MOV result.color, t; \n"
+ "END \n",
+ { CLAMP01(Param1[0] * 2.0 - 1.0),
+ CLAMP01(Param1[1] * 2.0 - 1.0),
+ CLAMP01(Param1[2] * 2.0 - 1.0),
+ CLAMP01(Param1[3] ),
+ },
+ DONT_CARE_Z
+ },
+
{
"CMP test",
"!!ARBfp1.0\n"
@@ -189,6 +236,21 @@ static const FragmentProgram Programs[] = {
DONT_CARE_Z
},
{
+ "DP3 test (2)",
+ "!!ARBfp1.0\n"
+ "PARAM p1 = program.local[1]; \n"
+ "TEMP t, r; \n"
+ "MOV t, p1; \n"
+ "DP3 r.x, t, t; \n"
+ "MUL result.color, r.xxxx, 0.5; \n"
+ "END \n",
+ { SMEAR(CLAMP01((Param1[0] * Param1[0] +
+ Param1[1] * Param1[1] +
+ Param1[2] * Param1[2]) * 0.5))
+ },
+ DONT_CARE_Z
+ },
+ {
"DP4 test",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"