Gabriele Tedeschi (gabriele++at++infobyte.it)
Tue, 20 Feb 1996 15:23:47 +0000
using Performer 2.0 we have a problem with texture paging in OpenGL on RE2 with
RM5. We wrote a simple program attached to this message that works fine
compiled in IrisGL and in a strange way in OpenGL.
As you can read from the source code this program creates two lists of 16
textures each 1MB large.
After the creation, in each frame one list is Idled and the other is Applyed
and
the return values of the 'pfIsTexLoaded' are printed for each texture.
As you can see when the program is compiled with IrisGL the results are as
follows:
pfIsTexLoaded return values
Frame: 1, List: One (Applayed), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 1, List: Two (Idled), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Frame: 2, List: One (Idled), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Frame: 2, List: Two (Applayed), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 3, List: One (Applayed), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 3, List: Two (Idled), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Frame: 4, List: One (Idled), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Frame: 4, List: Two (Applayed), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 5, List: One (Applayed), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 5, List: Two (Idled), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Frame: 6, List: One (Idled), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Frame: 6, List: Two (Applayed), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
While in OpenGL:
pfIsTexLoaded return values
Frame: 1, List: One (Applayed), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 1, List: Two (Idled), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Frame: 2, List: One (Idled), 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
Frame: 2, List: Two (Applayed), 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 3, List: One (Applayed), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 3, List: Two (Idled), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Frame: 4, List: One (Idled), 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
Frame: 4, List: Two (Applayed), 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 5, List: One (Applayed), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Frame: 5, List: Two (Idled), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Frame: 6, List: One (Idled), 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
Frame: 6, List: Two (Applayed), 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1
Are we missing something?
-- Gabriele Tedeschi Infobyte Spa VR R&D Software Engineer Via della Camilluccia 67 E-mail gabriele++at++infobyte.it 00135 Roma - Italy Tel +39-6-35572211 Fax +39-6-35572300
#include <Performer/pf.h>
typedef struct { pfList *one; pfList *two; } SharedData;
static SharedData *Shared = NULL;
void DrawConfigFunc(int pipe, uint stage);
void main(int argc, char *argv[]) { int i; int count; uint *image; pfTexture *tex;
pfInit();
Shared = (SharedData*)pfCalloc(1, sizeof(SharedData), pfGetSharedArena());
pfConfig();
Shared->one = pfNewList(sizeof(void*), 16, pfGetSharedArena()); Shared->two = pfNewList(sizeof(void*), 16, pfGetSharedArena());
for (i = 0; i < 16; i++) { image = (uint*)pfCalloc(1024 * 512, sizeof(uint), pfGetSharedArena()); tex = pfNewTex(pfGetSharedArena()); pfTexImage(tex, image, 4, 1024, 512, 1); pfTexFormat(tex, PFTEX_INTERNAL_FORMAT, PFTEX_RGBA_4); pfTexFilter(tex, PFTEX_MINFILTER, PFTEX_BILINEAR); pfTexFilter(tex, PFTEX_MAGFILTER, PFTEX_BILINEAR); pfAdd(Shared->one, tex); }
for (i = 0; i < 16; i++) { image = (uint*)pfCalloc(1024 * 512, sizeof(uint), pfGetSharedArena()); tex = pfNewTex(pfGetSharedArena()); pfTexImage(tex, image, 4, 1024, 512, 1); pfTexFormat(tex, PFTEX_INTERNAL_FORMAT, PFTEX_RGBA_4); pfTexFilter(tex, PFTEX_MINFILTER, PFTEX_BILINEAR); pfTexFilter(tex, PFTEX_MAGFILTER, PFTEX_BILINEAR); pfAdd(Shared->two, tex); }
pfFrame();
pfStageConfigFunc(-1, PFPROC_DRAW, DrawConfigFunc);
count = 8; while (count--) { pfSync();
pfConfigStage(-1, PFPROC_DRAW);
pfFrame(); }
pfExit(); }
void DrawConfigFunc(int pipe, uint stage) { static int first = TRUE; static int flag = FALSE; int i, n;
pfPushState(); pfEnable(PFEN_TEXTURE);
if (flag) { flag = FALSE; n = pfGetNum(Shared->one); for (i = 0; i < n; i++) { pfIdleTex((pfTexture*)pfGet(Shared->one, i)); } n = pfGetNum(Shared->two); for (i = 0; i < n; i++) { pfApplyTex((pfTexture*)pfGet(Shared->two, i)); } } else { flag = TRUE; if (first) { first = FALSE; } else { n = pfGetNum(Shared->two); for (i = 0; i < n; i++) { pfIdleTex((pfTexture*)pfGet(Shared->two, i)); } } n = pfGetNum(Shared->one); for (i = 0; i < n; i++) { pfApplyTex((pfTexture*)pfGet(Shared->one, i)); } }
printf("\nFrame: %d, List: One %s", pfGetFrameCount(), flag ? "(Applayed)" : " (Idled)"); n = pfGetNum(Shared->one); for (i = 0; i < n; i++) { printf(", %d", pfIsTexLoaded((pfTexture*)pfGet(Shared->one, i))); } printf("\nFrame: %d, List: Two %s", pfGetFrameCount(), !flag ? "(Applayed)" : " (Idled)"); n = pfGetNum(Shared->two); for (i = 0; i < n; i++) { printf(", %d", pfIsTexLoaded((pfTexture*)pfGet(Shared->two, i))); } printf("\n");
pfPopState(); }
#!smake -J 1 #-------------------------------------------------------------------# #-- Makefile for "idletest" --# #-------------------------------------------------------------------#
#-- #-- definitions #--
#if !defined(PFSTYLE) PFSTYLE = 32 #endif #if $(PFSTYLE) == "64" OBJECT_STYLE = 64 LIBBITSUF=64 PFRELEASE=N64 #endif #if $(PFSTYLE) == "N32" OBJECT_STYLE = N32_M3 LIBBITSUF=32 PFRELEASE=N32 #endif #if $(PFSTYLE) == "32" OBJECT_STYLE = 32 LIBBITSUF= PFRELEASE=O32 #endif
include $(ROOT)/usr/include/make/commondefs
LIBIGL = -ignore_unresolved -lgl -lfm LIBOGL = -ignore_unresolved -lGLU -lGL -lXext
SYSTEM_IRISGL = \ -limage \ ${LIBIGL} \ -lXmu \ -lX11 \ -lfpe \ -lm \ -lmalloc \ -lC
SYSTEM_OPENGL = \ -limage \ ${LIBOGL} \ -lXmu \ -lX11 \ -lfpe \ -lm \ -lmalloc \ -lC
#if $(PFSTYLE) == "64" SYSTEM_OPENGL = \ -limage \ ${LIBOGL} \ -lXmu \ -lX11 \ -lm \ -lC #endif
#if $(PFSTYLE) == "N32" SYSTEM_IRISGL = \ -limage \ ${LIBIGL} \ -lXmu \ -lX11 \ -lm \ -lC
SYSTEM_OPENGL = \ -limage \ ${LIBOGL} \ -lXmu \ -lX11 \ -lm \ -lC #endif
IBROOT ?= $(ROOT)
DSOLINKS = \ -L$(IBROOT)/usr/lib$(LIBBITSUF) \ -L$(IBROOT)/usr/lib$(LIBBITSUF)/libpfdb \ -L$(IBROOT)/lib$(LIBBITSUF)
DDSOLINKS = \ -L$(IBROOT)/usr/lib$(LIBBITSUF)/Performer/Debug \ -L$(IBROOT)/usr/lib$(LIBBITSUF)/Performer/Debug/libpfdb \ -L$(IBROOT)/lib$(LIBBITSUF)
DBGLINKS = \ -L$(IBROOT)/usr/lib$(LIBBITSUF)/Performer/DebugStatic \ -L$(IBROOT)/usr/lib$(LIBBITSUF)/Performer/DebugStatic/libpfdb \ -L$(IBROOT)/lib$(LIBBITSUF)
OPTLINKS = \ -L$(IBROOT)/usr/lib$(LIBBITSUF)/Performer/Static \ -L$(IBROOT)/usr/lib$(LIBBITSUF)/Performer/Static/libpfdb \ -L$(IBROOT)/lib$(LIBBITSUF)
IGLLIB = -lpf_igl -lpfdu_igl -lpfutil_igl -lpfui OGLLIB = -lpf_ogl -lpfdu_ogl -lpfutil_ogl -lpfui
#if defined(PFSTATIC_CONVERTERS) IGLLIB += -all $(PFSTATIC_CONVERTERS) -none OGLLIB += -all $(PFSTATIC_CONVERTERS) -none #endif
#-- base name of program TARGET = idletest
#-- object files from which target built OBJECTS = \ idletest.o
#-- #-- generic targets #--
#-- make optimized dso version of program by default default: ogldso
#-- make all versions of program all: igldbg iglopt igldso iglddso ogldbg oglopt ogldso oglddso
#-- clean up directories {remove junk} clean: if test -d DBG.$(PFRELEASE).IRISGL; then cd DBG.$(PFRELEASE).IRISGL ; rm -f ${OBJECTS} core ; cd .. ; fi if test -d DBG.$(PFRELEASE).OPENGL; then cd DBG.$(PFRELEASE).OPENGL ; rm -f ${OBJECTS} core ; cd .. ; fi if test -d OPT.$(PFRELEASE).IRISGL ; then cd OPT.$(PFRELEASE).IRISGL ; rm -f ${OBJECTS} core ; cd .. ; fi if test -d OPT.$(PFRELEASE).OPENGL ; then cd OPT.$(PFRELEASE).OPENGL ; rm -f ${OBJECTS} core ; cd .. ; fi
#-- remove all machine-built files clobber: clean if test -d OPT.$(PFRELEASE).IRISGL ; then rm -rf OPT.$(PFRELEASE).IRISGL ; fi if test -d OPT.$(PFRELEASE).OPENGL ; then rm -rf OPT.$(PFRELEASE).OPENGL ; fi if test -d DBG.$(PFRELEASE).IRISGL ; then rm -rf DBG.$(PFRELEASE).IRISGL ; fi if test -d DBG.$(PFRELEASE).OPENGL ; then rm -rf DBG.$(PFRELEASE).OPENGL ; fi rm -f ${TARGET}
#-- #-- library targets #--
#-- make a debugging version of the program igldbg: .MAKE ++at++ echo "\nMaking IrisGL DBG version of ${TARGET}" ++at++ if test ! -d DBG.$(PFRELEASE).IRISGL ; then mkdir -p DBG.$(PFRELEASE).IRISGL ; fi ++at++ cd DBG.$(PFRELEASE).IRISGL ; \ ${MAKE} -f ../Makefile OPTIMIZER=-g \ "LCDEFS=-DIRISGL" "LCXXDEFS=-DIRISGL" \ LIBRARIES='$(IGLLIB) -Wl,-none ${SYSTEM_IRISGL}' \ ${TARGET}.DBG ++at++ rm -f ${TARGET} ln -s DBG.$(PFRELEASE).IRISGL/${TARGET}.DBG ${TARGET}
ogldbg: .MAKE ++at++ echo "\nMaking OpenGL DBG version of ${TARGET}" ++at++ if test ! -d DBG.$(PFRELEASE).OPENGL ; then mkdir -p DBG.$(PFRELEASE).OPENGL ; fi ++at++ cd DBG.$(PFRELEASE).OPENGL ; \ ${MAKE} -f ../Makefile OPTIMIZER="-g"\ LIBRARIES='$(OGLLIB) -Wl,-none ${SYSTEM_OPENGL}' \ ${TARGET}.DBG ++at++ rm -f ${TARGET} ln -s DBG.$(PFRELEASE).OPENGL/${TARGET}.DBG ${TARGET}
#-- make an optimized version of the program iglopt: .MAKE ++at++ echo "\nMaking IrisGL OPT version of ${TARGET}" ++at++ if test ! -d OPT.$(PFRELEASE).IRISGL ; then mkdir -p OPT.$(PFRELEASE).IRISGL ; fi ++at++ cd OPT.$(PFRELEASE).IRISGL ; ${MAKE} -f ../Makefile OPTIMIZER="-O -Olimit 2000" \ "LCDEFS=-DIRISGL" "LCXXDEFS=-DIRISGL" \ LIBRARIES='$(IGLLIB) -Wl,-none ${SYSTEM_IRISGL}' \ ${TARGET}.OPT ++at++ rm -f ${TARGET} ln -s OPT.$(PFRELEASE).IRISGL/${TARGET}.OPT ${TARGET}
oglopt: .MAKE ++at++ echo "\nMaking OpenGL OPT version of ${TARGET}" ++at++ if test ! -d OPT.$(PFRELEASE).OPENGL ; then mkdir -p OPT.$(PFRELEASE).OPENGL ; fi ++at++ cd OPT.$(PFRELEASE).OPENGL ; ${MAKE} -f ../Makefile OPTIMIZER="-O " \ LIBRARIES='$(OGLLIB) -Wl,-none ${SYSTEM_OPENGL}' \ ${TARGET}.OPT ++at++ rm -f ${TARGET} ln -s OPT.$(PFRELEASE).OPENGL/${TARGET}.OPT ${TARGET}
#-- make a debugging version of the program that uses DSOs iglddso: .MAKE ++at++ echo "\nMaking IrisGL DDSO version of ${TARGET}" ++at++ if test ! -d DBG.$(PFRELEASE).IRISGL ; then mkdir -p DBG.$(PFRELEASE).IRISGL ; fi ++at++ cd DBG.$(PFRELEASE).IRISGL ; ${MAKE} -f ../Makefile OPTIMIZER="-g" \ "LCDEFS=-DIRISGL" "LCXXDEFS=-DIRISGL" \ LIBRARIES='$(IGLLIB) -Wl,-none ${SYSTEM_IRISGL}' \ ${TARGET}.DDSO ++at++ rm -f ${TARGET} ln -s DBG.$(PFRELEASE).IRISGL/${TARGET}.DDSO ${TARGET}
oglddso: .MAKE ++at++ echo "\nMaking OpenGL DDSO version of ${TARGET}" ++at++ if test ! -d DBG.$(PFRELEASE).OPENGL ; then mkdir -p DBG.$(PFRELEASE).OPENGL ; fi ++at++ cd DBG.$(PFRELEASE).OPENGL ; ${MAKE} -f ../Makefile OPTIMIZER="-g" \ LIBRARIES='$(OGLLIB) -Wl,-none ${SYSTEM_OPENGL}' \ ${TARGET}.DDSO ++at++ rm -f ${TARGET} ln -s DBG.$(PFRELEASE).OPENGL/${TARGET}.DDSO ${TARGET}
#-- make an optimized version of the program that uses DSOs igldso: .MAKE ++at++ echo "\nMaking IrisGL DSO version of ${TARGET}" ++at++ if test ! -d OPT.$(PFRELEASE).IRISGL ; then mkdir -p OPT.$(PFRELEASE).IRISGL ; fi ++at++ cd OPT.$(PFRELEASE).IRISGL ; ${MAKE} -f ../Makefile OPTIMIZER="-O -Olimit 2000" \ "LCDEFS=-DIRISGL" "LCXXDEFS=-DIRISGL" \ LIBRARIES='$(IGLLIB) -Wl,-none ${SYSTEM_IRISGL}' \ ${TARGET}.DSO ++at++rm -f ${TARGET} ln -s OPT.$(PFRELEASE).IRISGL/${TARGET}.DSO ${TARGET}
ogldso: .MAKE ++at++ echo "\nMaking OpenGL DSO version of ${TARGET}" ++at++ if test ! -d OPT.$(PFRELEASE).OPENGL ; then mkdir -p OPT.$(PFRELEASE).OPENGL ; fi ++at++ cd OPT.$(PFRELEASE).OPENGL ; ${MAKE} -f ../Makefile OPTIMIZER="-O " \ LIBRARIES='$(OGLLIB) -Wl,-none ${SYSTEM_OPENGL}' \ ${TARGET}.DSO ++at++ rm -f ${TARGET} ln -s OPT.$(PFRELEASE).OPENGL/${TARGET}.DSO ${TARGET}
dbg: ogldbg opt: oglopt dso: ogldso ddso: oglddso
#-- #-- internal targets #--
${TARGET}.DBG: ${OBJECTS} ${CC} ${CFLAGS} -o $++at++ ${OBJECTS} $(DBGLINKS) -all ${LIBRARIES}
${TARGET}.OPT: ${OBJECTS} ${CC} ${CFLAGS} -o $++at++ ${OBJECTS} $(OPTLINKS) -all ${LIBRARIES}
${TARGET}.DSO: ${OBJECTS} ${CC} ${CFLAGS} -o $++at++ ${OBJECTS} $(DSOLINKS) -all ${LIBRARIES}
${TARGET}.DDSO: ${OBJECTS} ${CC} ${CFLAGS} -o $++at++ ${OBJECTS} $(DDSOLINKS) -all ${LIBRARIES}
#-- objects are built from either unique or common files .PATH: ..
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:26 PDT