gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz gfx/libcallgl/callgl.cxx gzz/gfx/gl/MipzipL...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz gfx/libcallgl/callgl.cxx gzz/gfx/gl/MipzipL...
Date: Sun, 19 Jan 2003 05:08:12 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        03/01/19 05:08:12

Modified files:
        gfx/libcallgl  : callgl.cxx 
        gzz/gfx/gl     : MipzipLoader.java 
Added files:
        gzz/gfx/gl     : GLUtil.java 

Log message:
        Kludge mipzip discarding to work: copy the whole texture. NOT a good 
way to do it, but we have no choice right now, it seems

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcallgl/callgl.cxx.diff?tr1=1.41&tr2=1.42&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GLUtil.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/MipzipLoader.java.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: gzz/gfx/libcallgl/callgl.cxx
diff -u gzz/gfx/libcallgl/callgl.cxx:1.41 gzz/gfx/libcallgl/callgl.cxx:1.42
--- gzz/gfx/libcallgl/callgl.cxx:1.41   Sun Dec 29 15:33:12 2002
+++ gzz/gfx/libcallgl/callgl.cxx        Sun Jan 19 05:08:11 2003
@@ -166,6 +166,9 @@
                       getTokenf(v[3]));
        } else if (checkfunc(v, "BindTexture", 2)) {
          glBindTexture(getToken(v[1]), (GLuint)getToken(v[2]));
+       } else if (checkfunc(v, "DeleteTextures", 0, true)) {
+         vector<GLuint> textures = getiv<GLuint>(v, 1);
+         glDeleteTextures(v.size(), &(textures[0]));
        } else if (checkfunc(v, "DepthMask", 1)) {
          glDepthMask(getToken(v[1]));
        } else if (checkfunc(v, "ColorMask", 4)) {
Index: gzz/gzz/gfx/gl/MipzipLoader.java
diff -u gzz/gzz/gfx/gl/MipzipLoader.java:1.13 
gzz/gzz/gfx/gl/MipzipLoader.java:1.14
--- gzz/gzz/gfx/gl/MipzipLoader.java:1.13       Sat Jan 18 16:08:27 2003
+++ gzz/gzz/gfx/gl/MipzipLoader.java    Sun Jan 19 05:08:12 2003
@@ -151,6 +151,19 @@
            state = STATE_NONE;
        }
 
+       /** The texture level from the GL side was discarded.
+        * Because discard() doesn't work on NV drivers,
+        * do it this way.
+        */
+       synchronized void wasDiscarded() {
+           if(dbg)
+               pa("Discarded "+MipzipLoader.this+" "+level+
+                       " "+state);
+           loadedData = null;
+           state = STATE_NONE;
+       }
+
+
        /** Create a level.
         * @param l The mipmap level index
         * @param s The size string from the comment in the file, e.g."64x128"
@@ -179,7 +192,7 @@
      */
     synchronized public void loadToBaseLevelSynch(int level) throws 
IOException {
        for(int i=0; i<level; i++) {
-           levels[i].discard();
+           levels[i].discard(); // XXX fix
        }
        for(int i=level; i<levels.length; i++) {
            levels[i].loadData();
@@ -261,12 +274,20 @@
                if(dbg) pa("MipzipLoader "+this+" discard: "+
                        i+" "+levels[i].state+" "+
                        currentBaseLevel);
-               levels[i].discard();
-               if(currentBaseLevel <= i)
-                   setBaseLevel(i+1);
-               AbstractUpdateManager.doWhenIdle(r_runGL, 
-                           priority);
-               return;
+               if(false) {
+                   levels[i].discard();
+                   if(currentBaseLevel <= i)
+                       setBaseLevel(i+1);
+                   AbstractUpdateManager.doWhenIdle(r_runGL, 
+                               priority);
+                   return;
+               }
+               for(int j=0; j<goalBaseLevel; j++)
+                   levels[j].wasDiscarded();
+               GLUtil.reloadCompressed(tex, 
+                           goalBaseLevel, levels.length);
+               break;
+
            }
        }
        if(dbg) pa("MipzipLoader "+this+" no discards");




reply via email to

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