gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx demo/irregu3.py libutil/nvcode.py


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx demo/irregu3.py libutil/nvcode.py
Date: Mon, 27 Jan 2003 06:18:45 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        03/01/27 06:18:44

Modified files:
        gfx/demo       : irregu3.py 
        gfx/libutil    : nvcode.py 

Log message:
        clean up parseCombiner semantics

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/irregu3.py.diff?tr1=1.49&tr2=1.50&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libutil/nvcode.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/irregu3.py
diff -u gzz/gfx/demo/irregu3.py:1.49 gzz/gfx/demo/irregu3.py:1.50
--- gzz/gfx/demo/irregu3.py:1.49        Wed Nov 13 06:33:37 2002
+++ gzz/gfx/demo/irregu3.py     Mon Jan 27 06:18:43 2003
@@ -835,7 +835,7 @@
                                        cos(self.angle), sin(self.angle),
                                        -sin(self.angle), cos(self.angle))
         vs.matcher.add(cs4, "4")
-        vs.map.put(GLRen.createTextureMatrix(), cs4)
+        vs.map.put(GLRen.createSetMatrix("TEXTURE"), cs4)
         if using_multitex:
             vs.map.put(getDListNocoords("ActiveTexture TEXTURE1"))
             vs.map.put(GLRen.createTextureMatrix(), cs4)
Index: gzz/gfx/libutil/nvcode.py
diff -u gzz/gfx/libutil/nvcode.py:1.12 gzz/gfx/libutil/nvcode.py:1.13
--- gzz/gfx/libutil/nvcode.py:1.12      Tue Nov 26 05:48:41 2002
+++ gzz/gfx/libutil/nvcode.py   Mon Jan 27 06:18:44 2003
@@ -307,7 +307,7 @@
         if stage.has_key(c):
             code += ("CombinerStageParameterNV COMBINER%s_NV %s %s\n"
                      % (stage["num"], c, stage[c]))
-            stage["perStageConst"] = stage["num"]
+            stage["perStageConst"] = 1
             del stage[c]
             
     for comp in "RGB", "ALPHA":
@@ -486,8 +486,10 @@
 #   - A new combiner stage is started (unless empty) for all lines except for 
 #     those adjacent "REG = OUT" assignments that can fit in the current stage.
 #     To force a new stage, just insert a blank line.
-#   - Per stage constants are enabled unless all constant assignments are 
-#     either before or after all general combiner register assignments 
+#   - Per stage constants are enabled if any general combiner
+#     block (separated by empty lines) contains constant assignements.
+#     Put global constants into a separate block or into the final
+#     combiner block.
 #   - Only syntax is verified; Semantic errors may not be detected until
 #     the code is executed
 #
@@ -559,7 +561,8 @@
                 outcomp = left[0][2]
 
                 if outreg.startswith("CONST"):
-                    if stage["RGB"] or stage["ALPHA"]:
+                    if stage.has_key(outreg):
+                        print "WARING: a new stage implied by repeated", outreg
                         code += outputGeneralCombiner(stage)
                     stage[outreg] = line[pos+1:]
                 else:
@@ -571,6 +574,7 @@
                         return ""
 
                     if not addStageComp(stage[outcomp], out):
+                        print "WARNING: block split to multiple stages at", 
line
                         code += outputGeneralCombiner(stage)
                         stage[outcomp] = out
 
@@ -579,7 +583,7 @@
                 print "ERROR: left side must be register:", line
                 return ""
 
-    if stage["num"] == 0:
+    if stage["num"] == 0 and not (stage["RGB"] or stage["ALPHA"]):
         # Number of general combiners cannot be zero;
         # add dummy state to force output
         stage["RGB"]["foobar"] = 1
@@ -589,11 +593,7 @@
 
     init = ""
     if stage.has_key("perStageConst"):
-        if stage["perStageConst"] > 0 or stage.has_key("globalConst"):
-            init += "Enable PER_STAGE_CONSTANTS_NV\n"
-        else:
-            code = code.replace("CombinerStageParameterNV COMBINER0_NV",
-                                "CombinerParameterNV")
+        init += "Enable PER_STAGE_CONSTANTS_NV\n"
 
     init += "CombinerParameterNV NUM_GENERAL_COMBINERS_NV %s\n" % stage["num"]
         




reply via email to

[Prev in Thread] Current Thread [Next in Thread]