Skip to content

Commit

Permalink
smokeview source: change pp_GPUTHROTTLE to pp_GPU (will always thrott…
Browse files Browse the repository at this point in the history
…le gpu if pp_GPU is set
  • Loading branch information
gforney committed Oct 29, 2024
1 parent a7b6d49 commit 0a153e5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
18 changes: 9 additions & 9 deletions Source/smokeview/IOvolsmoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -2272,8 +2272,8 @@ void UpdateVolsmokeSupertexture(supermeshdata *smesh){
ni = meshi->ibar+1;
nj = meshi->jbar+1;
nk = meshi->kbar+1;
#ifdef pp_GPUTHROTTLE
GPUnframes+=3*ni*nj*nk;
#ifdef pp_GPU
GPUnframes += 3*ni*nj*nk;
#endif
glTexSubImage3D(GL_TEXTURE_3D,0,s_offset[0],s_offset[1],s_offset[2],ni,nj,nk,GL_RED, GL_FLOAT, smokedataptr);
}
Expand All @@ -2295,8 +2295,8 @@ void UpdateVolsmokeSupertexture(supermeshdata *smesh){
ni = meshi->ibar+1;
nj = meshi->jbar+1;
nk = meshi->kbar+1;
#ifdef pp_GPUTHROTTLE
GPUnframes+=3*ni*nj*nk;
#ifdef pp_GPU
GPUnframes += 3*ni*nj*nk;
#endif

glTexSubImage3D(GL_TEXTURE_3D,0,s_offset[0],s_offset[1],s_offset[2],ni,nj,nk,GL_RED, GL_FLOAT, firedataptr);
Expand All @@ -2319,8 +2319,8 @@ void UpdateVolsmokeSupertexture(supermeshdata *smesh){
ni = meshi->ibar;
nj = meshi->jbar;
nk = meshi->kbar;
#ifdef pp_GPUTHROTTLE
GPUnframes+=3*ni*nj*nk;
#ifdef pp_GPU
GPUnframes += 3*ni*nj*nk;
#endif

if(meshi->f_iblank_cell != NULL){
Expand All @@ -2346,8 +2346,8 @@ void UpdateVolsmokeTexture(meshdata *meshi){
ni = meshi->ibar+1;
nj = meshi->jbar+1;
nk = meshi->kbar+1;
#ifdef pp_GPUTHROTTLE
GPUnframes+=3*ni*nj*nk;
#ifdef pp_GPU
GPUnframes += 3*ni*nj*nk;
#endif
glActiveTexture(GL_TEXTURE0);
glTexSubImage3D(GL_TEXTURE_3D,0,ijk_offset[0],ijk_offset[1],ijk_offset[2],ni,nj,nk,GL_RED, GL_FLOAT, smokedata_local);
Expand Down Expand Up @@ -2381,7 +2381,7 @@ void DrawSmoke3DGPUVol(void){
float dcell;

// SVEXTERN int GPUload[30],GPUtime[30],SVDECL(nGPUframes,0),SVDECL(iGPUframes,0);
#ifdef pp_GPUTHROTTLE
#ifdef pp_GPU
START_TIMER(thisGPUtime);
if(thisGPUtime>lastGPUtime+0.25){
#ifdef _DEBUG
Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,7 @@ void MouseDragCB(int xm, int ym){
#endif

in_external=0;
#ifdef pp_GPUTHROTTLE
#ifdef pp_GPU
if(usegpu==1&&showvolrender==1&&show_volsmoke_moving==1){
if(ThrottleGpu()==1)return;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/glui_motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ extern "C" void GLUISceneMotionCB(int var){
return;
}

#ifdef pp_GPUTHROTTLE
#ifdef pp_GPU
if(usegpu==1&&showvolrender==1&&show_volsmoke_moving==1&&
(var==EYE_ROTATE||var==EYE_ROTATE_90||var==ROTATE_2AXIS||var==TRANSLATE_XY||var==GLUI_Z)
){
Expand Down
3 changes: 0 additions & 3 deletions Source/smokeview/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
#define pp_FAST // set fast startup by default
#define pp_GPU // support the GPU
#define pp_THREAD // turn on multi-threading
#ifdef pp_GPU
#define pp_GPUTHROTTLE // pp_GPU directive must also be set
#endif
//#define pp_FDS // create a 1 mesh input file

#ifdef pp_FRAME // turn on each frame type if pp_FRAME is set
Expand Down
2 changes: 1 addition & 1 deletion Source/smokeview/smokeviewvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ SVEXTERN int SVDECL(ngeominfoptrs,0);

SVEXTERN char startup_lang_code[3];

#ifdef pp_GPUTHROTTLE
#ifdef pp_GPU
SVEXTERN float SVDECL(thisGPUtime,0.0), SVDECL(lastGPUtime,0.0);
SVEXTERN float SVDECL(thisMOTIONtime,0.0), SVDECL(lastMOTIONtime,0.0);
SVEXTERN int SVDECL(GPUnframes,0),SVDECL(MOTIONnframes,0);
Expand Down

0 comments on commit 0a153e5

Please sign in to comment.