Re: pBuffer

New Message Reply Date view Thread view Subject view Author view

Francois Sillion (Francois.Sillion++at++imag.fr)
Tue, 15 Dec 1998 12:30:53 +0100


Hello Phil,

Here is more information about my Pbuffer problem:
Symptom is that (a) I can't seem to get a single-buffered Pbuffer, and (b)
when I request
a Pbuffer size of 512^2 or higher the contents of the buffer as returned by
glReadPixels
is garbage (black background with some ghost performer stats in it). Note that
when I request a 256^2 Pbuffer, or if I request PRESERVED_CONTENTS I get my
image OK.

From your previous answer though, I am not sure I understand correctly: are
you saying
that some other process could be stealing my Pbuffer evn while I am executing
my draw callback? I call glReadPixels immediately after pfDraw on the Pbuffer
draw callback.

Thanks for your help:

Phil Keslin wrote:
>
> Francois Sillion wrote:
> >
> > Rüdiger, Rob, Phil and others,
> >
> > Since there seems to be a lively discussion on Pbuffers, please let me ask my
> > last question again: I ran into some similar problems trying to find a correct
> > FB config for my Pbuffer: specifically I have to use a double-buffered buffer
> > because none of the available single-buffered ones is accepted by X. I don't
> > know if this double-buffering is the cause for my problem, but then I can't
> > get a correct rendering unless I specify the GLX_PRESERVED_CONTENTS attribute.
> > This is not an acceptable solution because it creates a huge performance
> > penalty in Performer.
>
> Hmm. I don't know why the Xserver will not allow allocation of single
> buffered pbuffers. What is the config of your IR pipe (gfxinfo and
> glxinfo output will suffice) and what is the framebuffer config you are
> requesting?
>
> More below...
>
> [snip]
>
> > In my application I have two pipeWindows, one rendering to a window on screen
> > and one rendering to an (offscreen) P-buffer. This works fine on an O2.
> >
> > I have the following problem running it on an iR:
> >
> > - If I create my P-buffer with the GLX_PRESERVED_CONTENTS_SGIX attribute,
> > rendering in the main (on-screen) window is slowed down terribly,
> > even
> > if the offscreen pipewindow is doing nothing (i.e. has no channel
> > attached to it).
> > SGI support identified this as the source of the performance problem
> > (thanks a lot to them!), but
>
> The Xserver is swapping drawables, very slow. We need to figure out how
> to get a shallow pbuffer (e.g., non-double buffered).
>
> > - if I do not specify the GLX_PRESERVED_CONTENTS_SGIX attribute,
> > performance
> > is as expected, but the image I extract from my Pbuffer is garbage.
>
> Something is binding another drawable before you do your read. When the
> pbuffer is invalidated, the framebuffer storage may be used by that
> other drawable. Given the snippet you provided, it is not clear where
> that could be happening though (another, unrelated process could also be
> doing it).
>
> > Looking at the Pbuffer doc, I found that when contents are not preserved, the
> > Pbuffer can be trashed at any time, but with an (asynchronous) notification by
> > means of a clobber event. The man page also suggests grabbing the X Server.
> >
> > - I tried grabbing the X server: the draw callback on my offscreen channel
> > looks then like:
> > =============================
> > static void
> > DrawOffScreenChannelCB ( pfChannel * pChannel , void * )
> > {
> > pfEnable(PFEN_LIGHTING);
> >
> > pChannel -> clear ();
> >
> > XGrabServer( pfGetCurWSConnection() );
> >
> > pfDraw();
> > GatherOffscreenData(); // this function simply calls glReadPixels to get
> > the
> > // image from the Pbuffer into memory
> >
> > XUngrabServer( pfGetCurWSConnection() );
> > }
> > =============================
> > but the contents of my image is still garbage...
>
> I'm not quite sure that server grabs will prevent processes that have
> already bound to the pipe from rendering and hence swapping your
> pbuffer.
>
> > - I also wanted to try reacting to CLOBBER events, but could not find
> > any examples. the man page says I can use glXSelectEventSGIX to register
> > for this type of event, but then what? I only know how to set an
> > event
> > handler for an Xt Widget using XtAddEventHandler.. but my pbuffer is
> > not
> > a widget! how do I specify how to react to a clobber event?
>
> I've never found clobber events of much use. To make it work you'll need
> a separate Display connection just for these events and you'll need to
> query the event queue prior to every read. This must happen in the DRAW
> process.
>
> > - One final note: on the iR my program allocates a DOUBLE-BUFFERED pbuffer,
> > because the (single) FB config found for single buffer pbuffers is
> > refused by glXCreateGLXPbufferSGIX (BadAlloc (insufficient resources
> > for
> > operation). Could this have to do with my problem? in case you
> > wonder,
> > I HAVE tried reading pixels from the front and the back buffers, I
> > have
> > garbage in both!
>
> Need to figure out why it won't let you have a single buffered visual.
> The requested info should help quite a bit.
>
> - Phil
> --
> Phil Keslin <philk++at++engr.sgi.com>

-- 
+------------------+--------------------------------------------------------+
| Francois SILLION | iMAGIS-GRAVIR/IMAG/INRIA, BP 53, 38041 Grenoble Cedex 9|
|     '            | France. Tel: +33 4 76 51 43 54 - Fax: +33 4 76 63 55 80|
+------------------+--------+-----------------------------------------------+
| Francois.Sillion++at++imag.fr  |  http://www-imagis.imag.fr/~Francois.Sillion  |
+---------------------------+-----------------------------------------------+

Here is the code fragment used to create the Pbuffer:

Note that I request only a minimal configuration to try and get as many candidates as possible... first trying single-buffered frame buffers, then double-buffered ones.

============================================================================= attrList[n++] = GLX_RENDER_TYPE_SGIX; attrList[n++] = GLX_RGBA_BIT_SGIX; attrList[n++] = GLX_DRAWABLE_TYPE_SGIX; attrList[n++] = GLX_PBUFFER_BIT_SGIX; attrList[n++] = GLX_RED_SIZE; attrList[n++] = 1; attrList[n++] = GLX_GREEN_SIZE; attrList[n++] = 1; attrList[n++] = GLX_BLUE_SIZE; attrList[n++] = 1; attrList[n++] = GLX_DEPTH_SIZE; attrList[n++] = 1; attrList[n++] = GLX_DOUBLEBUFFER; attrList[n++] = False; attrList[n++] = None; if ( CreatePBuffer ( width , height , attrList ) == 0 ) { fprintf(stderr, "Warning : cannot create a single-buffer PBuffer, trying with double-buffer\n"); n = 0; attrList[n++] = GLX_RENDER_TYPE_SGIX; attrList[n++] = GLX_RGBA_BIT_SGIX; attrList[n++] = GLX_DRAWABLE_TYPE_SGIX; attrList[n++] = GLX_PBUFFER_BIT_SGIX; attrList[n++] = GLX_RED_SIZE; attrList[n++] = 1; attrList[n++] = GLX_GREEN_SIZE; attrList[n++] = 1; attrList[n++] = GLX_BLUE_SIZE; attrList[n++] = 1; attrList[n++] = GLX_DEPTH_SIZE; attrList[n++] = 1; attrList[n++] = GLX_DOUBLEBUFFER; attrList[n++] = True; attrList[n++] = None; if ( CreatePBuffer ( width , height , attrList ) == 0 ) { fprintf(stderr, "Warning : cannot create a PBuffer, try Pixmap\n"); ...

============================================================================= The 'CreatePBuffer' function basically does this:

int OffScreenArea:: CreatePBuffer ( int width, int height , int * pAttribList ) { static int pbAttribs[] = { GLX_LARGEST_PBUFFER_SGIX, False, GLX_PRESERVED_CONTENTS_SGIX, False, None };

/* Get list of possible frame buffer configurations */ pfbConfigs = glXChooseFBConfigSGIX( i_pDisplay , i_Screen , pAttribList , &nbConfigs); fprintf(stderr,"Ready to try %d frame buffer configs:\n",nbConfigs);

// Print info about all possible frame buffer configs

for ( i = 0 ; i < nbConfigs ; i++ ) { fbConfig = pfbConfigs[i];

XVisualInfo * myVisual = glXGetVisualFromFBConfigSGIX ( i_pDisplay , fbConfig );

char cmd[256]; sprintf(cmd,"findvis id==0x%x",myVisual->visualid); system(cmd); }

// run through the loop again, trying to create a PBuffer...

for ( i = 0 ; i < nbConfigs ; i++ ) { fbConfig = pfbConfigs[i];

/* Catch X protocol errors with our own error handler */ OutOfMemory = False; oldHandler = XSetErrorHandler( myXErrorHandler );

pbuffer = glXCreateGLXPbufferSGIX ( i_pDisplay , fbConfig , width , height , pbAttribs ); /* Restore original X error handler */ (void) XSetErrorHandler( oldHandler );

XVisualInfo * myVisual = glXGetVisualFromFBConfigSGIX ( i_pDisplay , fbConfig );

if ( pbuffer == NULL ) { fprintf(stderr,"glXCreateGLXPbufferSGIX failed for visual id==0x%x\n", myVisual->visualid); } else { fprintf(stderr,"PBuffer successfully created for visual id==0x%x\n", myVisual->visualid); }

if ( !FoundXError && (pbuffer != NULL ) ) break; } XFree ( pfbConfigs ); if ( ( i_Drawable = pbuffer) == NULL) return 0;

... then create GLX context, etc...

============================================================================= When I run this code, I get the following output:

Ready to try 1 frame buffer configs: 0x54, RGBA 12/12/12/12, Z 23, S 8, accum 25/25/25/25 Encountered X error glXCreateGLXPbufferSGIX failed for visual id==0x54 Warning : cannot create a single-buffer PBuffer, trying with double-buffer Ready to try 6 frame buffer configs: 0x50, RGBA 12/12/12/12, db, Z 23, S 1 0x51, RGBA 12/12/12/12, db, Z 23, S 8 0x56, RGBA 12/12/12/12, db, aux 1, Z 23, S 8, accum 25/25/25/25 0x75, RGBA 10/10/10/0, db, Z 23, S 1 0x77, RGBA 10/10/10/0, db, Z 23, S 8 0x7b, RGBA 10/10/10/0, db, Z 23, S 8, accum 25/25/25/0 PBuffer successfully created for visual id==0x50 Notice : using double-buffer PBuffer for offScreen rendering

Therefore, I only get one possible *single-buffered* frame buffer config to try, and I don't understand why! given that it has 25 bits of accum buffer for each R,G,B,A, I can understand thaht it's hard to find a Pbuffer for it! but how come I can't get more options?

============================================================================= Output of glxinfo:

display: :0 server glx vendor string: SGI server glx version string: 1.2 Irix 6.5 server glx extensions (GLX_): EXT_import_context, EXT_visual_info, EXT_visual_rating, SGI_make_current_read, SGI_swap_control, SGI_video_sync, SGIS_multisample, SGIX_fbconfig, SGIX_hyperpipe, SGIX_pbuffer, SGIX_swap_barrier, SGIX_swap_group, SGIX_video_resize, SGIX_video_source. client glx version 1.1 client glx extensions (GLX_): EXT_import_context, EXT_visual_info, EXT_visual_rating, SGI_make_current_read, SGI_swap_control, SGI_video_sync, SGIS_multisample, SGIX_fbconfig, SGIX_hyperpipe, SGIX_pbuffer, SGIX_swap_barrier, SGIX_swap_group, SGIX_video_resize, SGIX_video_source. OpenGL vendor string: SGI OpenGL renderer string: IRL/M/1/64/4 OpenGL version string: 1.1 Irix 6.5 OpenGL extensions (GL_): EXT_abgr, EXT_blend_color, EXT_blend_logic_op, EXT_blend_minmax, EXT_blend_subtract, EXT_convolution, EXT_copy_texture, EXT_histogram, EXT_packed_pixels, EXT_polygon_offset, EXT_subtexture, EXT_texture, EXT_texture3D, EXT_texture_object, EXT_vertex_array, SGI_color_matrix, SGI_color_table, SGI_texture_color_table, SGIS_detail_texture, SGIS_fog_function, SGIS_multisample, SGIS_point_line_texgen, SGIS_point_parameters, SGIS_sharpen_texture, SGIS_texture_edge_clamp, SGIS_texture_filter4, SGIS_texture_lod, SGIS_texture_select, SGIX_calligraphic_fragment, SGIX_clipmap, SGIX_fog_offset, SGIX_instruments, SGIX_interlace, SGIX_ir_instrument1, SGIX_flush_raster, SGIX_list_priority, SGIX_reference_plane, SGIX_shadow, SGIX_shadow_ambient, SGIX_sprite, SGIX_subdiv_patch, SGIX_texture_add_env, SGIX_texture_lod_bias, SGIX_texture_scale_bias, SGIX_depth_texture. glu version: 1.2 Irix 6.5 glu extensions (GLU_): EXT_abgr, EXT_nurbs_tessellator, EXT_object_space_tess, EXT_packed_pixels, EXT_texture, SGI_filter4_parameters.

visual x bf lv rg d st r g b a ax dp st accum buffs ms id dep cl sp sz l ci b ro sz sz sz sz bf th cl r g b a ns b ----------------------------------------------------------------- 0x21 2 pc y 2 1 c y . . . . . . . . . . . . . . 0x22 2 pc y 2 1 c . . . . . . . . . . . . . . . 0x23 2 pc . 2 1 c y . . . . . . . . . . . . . . 0x24 2 pc . 2 1 c . . . . . . . . . . . . . . . 0x25 4 pc y 4 1 c y . . . . . . . . . . . . . . 0x26 4 pc y 4 1 c . . . . . . . . . . . . . . . 0x27 4 pc . 4 1 c y . . . . . . . . . . . . . . 0x28 4 pc . 4 1 c . . . . . . . . . . . . . . . 0x29 8 pc . 8 . c . . . . . . . 23 8 . . . . . . 0x2f 8 pc y 8 1 c y . . . . . . . . . . . . . . 0x30 8 pc y 8 1 c . . . . . . . . . . . . . . . 0x31 8 pc . 8 1 c y . . . . . . . . . . . . . . 0x32 8 pc . 8 1 c . . . . . . . . . . . . . . . 0x38 12 pc . 12 . b . . 16 . . 16 . . . . . . . . . 0x39 12 pc . 12 . b y . 16 . . 16 . . . . . . . . . 0x3a 12 pc . 12 . b y . 16 . . 16 . 23 1 . . . . . . 0x3b 12 pc . 12 . b . y 16 . . 16 . . . . . . . . . 0x3c 12 pc . 12 . b y . 16 . . 16 . 23 8 . . . . . . 0x3d 12 pc . 12 . b y y 16 . . 16 . . . . . . . . . 0x3e 12 pc . 12 . b . . 16 . . 16 . 23 8 25 . . 25 . . 0x3f 12 pc . 12 . b y . 16 . . 16 1 23 8 25 . . 25 . . 0x40 12 pc . 12 . b . y 16 . . 16 . 23 8 25 . . 25 . . 0x41 12 pc . 12 . b y y 16 . . 16 1 23 8 25 . . 25 . . 0x42 15 tc y 16 1 r . . 5 5 5 1 . . . . . . . . . 0x43 15 tc . 16 1 r . . 5 5 5 1 . . . . . . . . . 0x44 16 sg . 16 . r . . 16 . . 16 . . . . . . . . . 0x45 16 sg . 16 . r y . 16 . . 16 . . . . . . . . . 0x46 16 sg . 16 . r y . 16 . . 16 . 23 1 . . . . . . 0x47 16 sg . 16 . r . y 16 . . 16 . . . . . . . . . 0x48 16 sg . 16 . r y . 16 . . 16 . 23 8 . . . . . . ----------------------------------------------------------------- id dep cl xp bs lv rg d st rb gb bb ab ax dp st ar ag ab aa ms,b ----------------------------------------------------------------- 0x49 16 sg . 16 . r y y 16 . . 16 . . . . . . . . . 0x4a 16 sg . 16 . r . . 16 . . 16 . 23 8 25 . . 25 . . 0x4b 16 sg . 16 . r y . 16 . . 16 1 23 8 25 . . 25 . . 0x4c 16 sg . 16 . r . y 16 . . 16 . 23 8 25 . . 25 . . 0x4d 16 sg . 16 . r y y 16 . . 16 1 23 8 25 . . 25 . . 0x4e 24 tc . 48 . r . . 12 12 12 12 . . . . . . . . . 0x4f 24 tc . 48 . r y . 12 12 12 12 . . . . . . . . . 0x50 24 tc . 48 . r y . 12 12 12 12 . 23 1 . . . . . . 0x51 24 tc . 48 . r y . 12 12 12 12 . 23 8 . . . . . . 0x52 24 tc . 48 . r . y 12 12 12 12 . . . . . . . . . 0x53 24 tc . 48 . r y y 12 12 12 12 . . . . . . . . . 0x54 24 tc . 48 . r . . 12 12 12 12 . 23 8 25 25 25 25 . . 0x55 24 tc . 48 . r y . 12 12 12 12 1 . . . . . . 4 1 0x56 24 tc . 48 . r y . 12 12 12 12 1 23 8 25 25 25 25 . . 0x57 24 tc . 48 . r . . 12 12 12 12 . 15 1 . . . . 4 1 0x58 24 tc . 48 . r . . 12 12 12 12 . 16 . . . . . 4 1 0x59 24 tc . 48 . r y . 12 12 12 12 . . . 25 25 25 25 4 1 0x5a 24 tc . 48 . r y . 12 12 12 12 . 23 8 . . . . 4 1 0x5b 24 tc . 48 . r . y 12 12 12 12 . 15 1 . . . . 4 1 0x5c 24 tc . 48 . r . y 12 12 12 12 . 16 . . . . . 4 1 0x5d 24 tc . 48 . r . . 12 12 12 12 . 15 1 25 25 25 25 4 1 0x5e 24 tc . 48 . r . . 12 12 12 12 . 16 . 25 25 25 25 4 1 0x5f 24 tc . 48 . r . . 12 12 12 12 . 23 1 . . . . 4 1 0x60 24 tc . 48 . r y . 12 12 12 12 1 15 1 . . . . 4 1 0x61 24 tc . 48 . r y . 12 12 12 12 1 16 . . . . . 4 1 0x62 24 tc . 48 . r . y 12 12 12 12 . 23 1 . . . . 4 1 0x63 24 tc . 48 . r . y 12 12 12 12 . . . . . . . 4 1 0x64 24 tc . 48 . r . y 12 12 12 12 . 23 8 25 25 25 25 . . 0x65 24 tc . 48 . r y y 12 12 12 12 . 15 1 . . . . 4 1 0x66 24 tc . 48 . r y y 12 12 12 12 . 16 . . . . . 4 1 ----------------------------------------------------------------- id dep cl xp bs lv rg d st rb gb bb ab ax dp st ar ag ab aa ms,b ----------------------------------------------------------------- 0x67 24 tc . 48 . r . . 12 12 12 12 . 23 1 25 25 25 25 4 1 0x68 24 tc . 48 . r . . 12 12 12 12 . . . 25 25 25 25 4 1 0x69 24 tc . 48 . r . . 12 12 12 12 . 23 8 . . . . 4 1 0x6a 24 tc . 48 . r y . 12 12 12 12 . 15 1 25 25 25 25 4 1 0x6b 24 tc . 48 . r y . 12 12 12 12 . 16 . 25 25 25 25 4 1 0x6c 24 tc . 48 . r y . 12 12 12 12 1 23 1 . . . . 4 1 0x6d 24 tc . 48 . r . y 12 12 12 12 . . . 25 25 25 25 4 1 0x6e 24 tc . 48 . r . y 12 12 12 12 . 23 8 . . . . 4 1 0x6f 24 tc . 48 . r y y 12 12 12 12 . 23 1 . . . . 4 1 0x70 24 tc . 48 . r y y 12 12 12 12 1 . . . . . . 4 1 0x71 24 tc . 48 . r y y 12 12 12 12 1 23 8 25 25 25 25 . . 0x73 30 tc . 30 . r . . 10 10 10 . . . . . . . . . . 0x74 30 tc . 30 . r y . 10 10 10 . . . . . . . . . . 0x75 30 tc . 30 . r y . 10 10 10 . . 23 1 . . . . . . 0x76 30 tc . 30 . r . y 10 10 10 . . . . . . . . . . 0x77 30 tc . 30 . r y . 10 10 10 . . 23 8 . . . . . . 0x78 30 tc . 30 . r y y 10 10 10 . . . . . . . . . . 0x79 30 tc . 30 . r y . 10 10 10 . . 15 1 . . . . 4 1 0x7a 30 tc . 30 . r y . 10 10 10 . . 16 . . . . . 4 1 0x7b 30 tc . 30 . r y . 10 10 10 . . 23 8 25 25 25 . . . 0x7c 30 tc . 30 . r . . 10 10 10 . . . . 25 25 25 . 4 1 0x7d 30 tc . 30 . r y . 10 10 10 . 1 . . 25 25 25 . 4 1 0x7e 30 tc . 30 . r . . 10 10 10 . . 15 1 25 25 25 . 4 1 0x7f 30 tc . 30 . r . . 10 10 10 . . 16 . 25 25 25 . 4 1 0x80 30 tc . 30 . r . y 10 10 10 . . . . 25 25 25 . 4 1 0x81 30 tc . 30 . r . . 10 10 10 . . . . 25 25 25 . 8 1 0x82 30 tc . 30 . r . . 10 10 10 . . 23 1 25 25 25 . 4 1 0x83 30 tc . 30 . r y . 10 10 10 . 1 15 1 25 25 25 . 4 1 0x84 30 tc . 30 . r y . 10 10 10 . 1 16 . 25 25 25 . 4 1 0x85 30 tc . 30 . r y y 10 10 10 . 1 . . 25 25 25 . 4 1 ----------------------------------------------------------------- id dep cl xp bs lv rg d st rb gb bb ab ax dp st ar ag ab aa ms,b ----------------------------------------------------------------- 0x86 30 tc . 30 . r . . 10 10 10 . . 15 1 . . . . 8 1 0x87 30 tc . 30 . r . . 10 10 10 . . 16 . . . . . 8 1 0x88 30 tc . 30 . r . . 10 10 10 . . 23 8 25 25 25 . 4 1 0x89 30 tc . 30 . r y . 10 10 10 . 1 . . 25 25 25 . 8 1 0x8a 30 tc . 30 . r y . 10 10 10 . 1 23 1 25 25 25 . 4 1 0x8b 30 tc . 30 . r . y 10 10 10 . . 15 1 25 25 25 . 4 1 0x8c 30 tc . 30 . r . y 10 10 10 . . 16 . 25 25 25 . 4 1 0x8d 30 tc . 30 . r y y 10 10 10 . 1 23 8 . . . . 4 1 0x8e 30 tc . 30 . r . . 10 10 10 . . 15 1 25 25 25 . 8 1 0x8f 30 tc . 30 . r . . 10 10 10 . . 16 . 25 25 25 . 8 1 0x90 30 tc . 30 . r y . 10 10 10 . . 23 1 . . . . 8 1 0x91 30 tc . 30 . r y . 10 10 10 . 1 15 1 . . . . 8 1 0x92 30 tc . 30 . r y . 10 10 10 . 1 16 . . . . . 8 1 0x93 30 tc . 30 . r y . 10 10 10 . 1 23 8 25 25 25 . 4 1 0x94 30 tc . 30 . r . y 10 10 10 . . . . 25 25 25 . 8 1 0x95 30 tc . 30 . r . y 10 10 10 . . 23 1 25 25 25 . 4 1 0x96 30 tc . 30 . r y y 10 10 10 . . 15 1 . . . . 8 1 0x97 30 tc . 30 . r y y 10 10 10 . . 16 . . . . . 8 1 0x98 30 tc . 30 . r y y 10 10 10 . . 23 8 25 25 25 . 4 1 0x99 30 tc . 30 . r y y 10 10 10 . 1 15 1 25 25 25 . 4 1 0x9a 30 tc . 30 . r y y 10 10 10 . 1 16 . 25 25 25 . 4 1 0x9b 30 tc . 30 . r . . 10 10 10 . . 23 8 . . . . 8 1 0x9c 30 tc . 30 . r . . 10 10 10 . . 23 1 . . . . 8 1 0x9d 30 tc . 30 . r y . 10 10 10 . . 15 1 25 25 25 . 8 1 0x9e 30 tc . 30 . r y . 10 10 10 . . 16 . 25 25 25 . 8 1 0x9f 30 tc . 30 . r . y 10 10 10 . . 23 1 . . . . 8 1 0xa0 30 tc . 30 . r . y 10 10 10 . . 15 1 . . . . 8 1 0xa1 30 tc . 30 . r . y 10 10 10 . . 16 . . . . . 8 1 0xa2 30 tc . 30 . r . y 10 10 10 . . 23 8 25 25 25 . 4 1 0xa3 30 tc . 30 . r y y 10 10 10 . 1 . . 25 25 25 . 8 1 ----------------------------------------------------------------- id dep cl xp bs lv rg d st rb gb bb ab ax dp st ar ag ab aa ms,b ----------------------------------------------------------------- 0xa4 30 tc . 30 . r y y 10 10 10 . 1 23 1 25 25 25 . 4 1

============================================================================= Output of gfxinfo:

Graphics board 0 is "KONAL" graphics. Managed (":0.0") 1280x1024 Display has 2 channels 4 GEs (of 4), occmask = 0x0f 4MB external BEF ram, 32bit path 1 RM7 board (of 1) 1/0/0/0 Texture Memory: 64MB/-/-/- Medium pixel depth 32K cmap Channel 0: Origin = (0,0) Video Output: 1280 pixels, 1024 lines, 72.00Hz (1280x1024_72.vfo) Channel 1: Origin = (0,0) Video Output: 1280 pixels, 1024 lines, 72.00Hz (1280x1024_72.vfo)

============================================================================= Phil Keslin wrote: > > Francois Sillion wrote: > > > > Rüdiger, Rob, Phil and others, > > > > Since there seems to be a lively discussion on Pbuffers, please let me ask my > > last question again: I ran into some similar problems trying to find a correct > > FB config for my Pbuffer: specifically I have to use a double-buffered buffer > > because none of the available single-buffered ones is accepted by X. I don't > > know if this double-buffering is the cause for my problem, but then I can't > > get a correct rendering unless I specify the GLX_PRESERVED_CONTENTS attribute. > > This is not an acceptable solution because it creates a huge performance > > penalty in Performer. > > Hmm. I don't know why the Xserver will not allow allocation of single > buffered pbuffers. What is the config of your IR pipe (gfxinfo and > glxinfo output will suffice) and what is the framebuffer config you are > requesting? > > More below... > > [snip] > > > In my application I have two pipeWindows, one rendering to a window on screen > > and one rendering to an (offscreen) P-buffer. This works fine on an O2. > > > > I have the following problem running it on an iR: > > > > - If I create my P-buffer with the GLX_PRESERVED_CONTENTS_SGIX attribute, > > rendering in the main (on-screen) window is slowed down terribly, > > even > > if the offscreen pipewindow is doing nothing (i.e. has no channel > > attached to it). > > SGI support identified this as the source of the performance problem > > (thanks a lot to them!), but > > The Xserver is swapping drawables, very slow. We need to figure out how > to get a shallow pbuffer (e.g., non-double buffered). > > > - if I do not specify the GLX_PRESERVED_CONTENTS_SGIX attribute, > > performance > > is as expected, but the image I extract from my Pbuffer is garbage. > > Something is binding another drawable before you do your read. When the > pbuffer is invalidated, the framebuffer storage may be used by that > other drawable. Given the snippet you provided, it is not clear where > that could be happening though (another, unrelated process could also be > doing it). > > > Looking at the Pbuffer doc, I found that when contents are not preserved, the > > Pbuffer can be trashed at any time, but with an (asynchronous) notification by > > means of a clobber event. The man page also suggests grabbing the X Server. > > > > - I tried grabbing the X server: the draw callback on my offscreen channel > > looks then like: > > ============================= > > static void > > DrawOffScreenChannelCB ( pfChannel * pChannel , void * ) > > { > > pfEnable(PFEN_LIGHTING); > > > > pChannel -> clear (); > > > > XGrabServer( pfGetCurWSConnection() ); > > > > pfDraw(); > > GatherOffscreenData(); // this function simply calls glReadPixels to get > > the > > // image from the Pbuffer into memory > > > > XUngrabServer( pfGetCurWSConnection() ); > > } > > ============================= > > but the contents of my image is still garbage... > > I'm not quite sure that server grabs will prevent processes that have > already bound to the pipe from rendering and hence swapping your > pbuffer. > > > - I also wanted to try reacting to CLOBBER events, but could not find > > any examples. the man page says I can use glXSelectEventSGIX to register > > for this type of event, but then what? I only know how to set an > > event > > handler for an Xt Widget using XtAddEventHandler.. but my pbuffer is > > not > > a widget! how do I specify how to react to a clobber event? > > I've never found clobber events of much use. To make it work you'll need > a separate Display connection just for these events and you'll need to > query the event queue prior to every read. This must happen in the DRAW > process. > > > - One final note: on the iR my program allocates a DOUBLE-BUFFERED pbuffer, > > because the (single) FB config found for single buffer pbuffers is > > refused by glXCreateGLXPbufferSGIX (BadAlloc (insufficient resources > > for > > operation). Could this have to do with my problem? in case you > > wonder, > > I HAVE tried reading pixels from the front and the back buffers, I > > have > > garbage in both! > > Need to figure out why it won't let you have a single buffered visual. > The requested info should help quite a bit. > > - Phil > -- > Phil Keslin <philk++at++engr.sgi.com>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Dec 15 1998 - 03:31:35 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.