Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: cbs+@cs.cmu.edu (Clauss Strauch)
Subject: X server crashes on ZLX/Mn alphas
Date: Wed, 27 Apr 1994 21:01:43 GMT	[thread overview]
Message-ID: <Coxrqw.8v5.3@cs.cmu.edu> (raw)


 	Using pphittest() in DEC PHIGS with Z-buffering turned on crashes 
the X server on ZLX/Mn machines.  pphittest() works as expected with 
Z-buffering turned off.  This behavior is reproducible on both a ZLX/M2
workstation running OSF/1 V1.3A (with patches), Open3D 2.1, and DEC PHIGS
2.4A, and also on a ZLX/M1 running OSF/1 V2.0, Open3D 2.2, and DEC PHIGS 2.5.
I've included below a sample program that illustrates this bug.	Is there a 
known bug-fix for this problem (besides not using pphittest)?

							-- Clauss

-----------------------------------------------------------------
/*
 *  This is a DEC PHIGS program to illustrate a problem with pphittest() 
 *  and z-buffering.  	All it does is open a window, create a stucture
 *  (these are from supplied routines), optionally set the hidden line-hidden
 *  surface mode for z-buffering, and then call the hittest. Running it 
 *  without an argument will give normal results.  Running it with any 
 *  argument will turn on z-buffering and crash the X server on ZLX 
 *  workstations.
 *
 */


/* pick & choice example program
 *
 * displays a 9 x 9 grid of markers.
 * displays a main choice menu in event mode to select:
 *     1 pick filter
 *     2 pick path order
 *     3 pick path depth
 *     4 pick
 *     5 EXIT
 * The first 3 selections display a sub-menu in request mode
 * to select the desired value.
 *
 * The 4th selection requests pick input.. use DUAL highlight
 * method for EVEN rows & LINE highlight method for ODD rows
 */

#include <stdio.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <phigs.h>
#include <phigs_msgs.h>

/* Definitions of some unique integers */
#define WSID 1
#define DEV1 1
#define DEV6 6
#define DEV7 7
#define DEV8 8
#define EXIT 5
#define ODDMARK  1
#define EVENMARK 2
#define ODDROW   3
#define EVENROW  4
#define TOP      5
#define SQUARE   6
#define TEXT_ST_ID 9999

#define DEFAULT_VIEW_INDEX 0
#define VIEWLABEL 1

Pint ws_id;

main( argc, argv )int argc; char **argv;
{
    Pintlst      inclusion    = { 0, 0 };
    Pintlst      exclusion    = { 0, 0 };
    int		inc_array[2]= {ODDROW, EVENROW};
    Ppoint pnt;
    int depth;
    Pqpick pick;
    Ppickpathel pick_path_array[100];
    int done, i;

    ws_id = WSID;

  /* Open PHIGS and the workstation. */
    popenphigs( 0, 0 );
    popenws( WSID, PPCONID_DEFAULT, 240);

  /* Build the structure network, depth 3. */
    dostruct();

    inclusion.number = 2;
    inclusion.integers = inc_array;

    exclusion.number = 0;
    exclusion.integers = NULL;

    if (argc != 1)
	psethlhsrmode(ws_id, 2);

    done = 0;
    depth = 100;
    pick.pick.pick_path = pick_path_array;
    pnt.x = 100;
    pnt.y = 100;
    predrawallstruct( WSID, PPERFORM );
    pphittest(ws_id, &pnt, 10.0, PBOTTOM_FIRST, &inclusion,
	      &exclusion, &depth, &pick);
    ReportPick(&pick);

    pclosews( WSID );
    pclosephigs();
}



/*
 * This routine creates a hierarchical structure network that
 * generates a picture consisting of a 9x9 array of point markers.  
 * Each of the markers is generated by one of two bottom level structures,
 * ODDMARK and EVENMARK, each containing one single-element polymarker
 * primitive.  Note that in modeling coordinates, both ODDMARK and EVENMARK
 * generate the same marker.  The only difference between these structures
 * is in the PICKID, which has no effect on the picture.
 * 
 * The second level structures are ODDROW and EVENROW.  These differ
 * in the nameset attribute, but are otherwise the same.  Each
 * produces the same row of markers along the MC x-axis by repeated
 * execution of the bottom level structures, with appropriate local
 * modeling translations, alternating between the ODDMARK AND EVENMAR
 * first level structures for the odd columns and even columns.
 *
 * The top level structure has 9 rows, each obtained by translating
 * one of the second level structures by unique distance in the y
 * direction, alternating between OODROW and EVENROW for the odd and
 * even rows.  Note that the TOP structure does not set the NAMESET,
 * so at traversal time the NAMESET is by default empty, except when
 * executing one of the second level structures or their children;
 * that is the contents of the NAMESET attribute varies between ODDROW
 * and EVENROW depending on the row.
 */

dostruct() 
{
       int      i;
       int      xerror;
static Ppoint3  pt = {0.0,0.0,0.0};
static Pvector3 displace = {0.0,0.0,0.5};
       Pmatrix3 xform;
       Pint     rownames[2];
static Pintlst  rownamelist = {0,0};
       int view_ind=1;

    rownamelist.integers = rownames;

  /* Bottom level structures */

    popenstruct( ODDMARK );
    psetpickid( ODDMARK );
    ppolymarker3( 1, &pt );
    pclosestruct();

    popenstruct( EVENMARK );
    psetpickid( EVENMARK );
    ppolymarker3( 1, &pt );
    pclosestruct();

  /* Second level structures */
    popenstruct( ODDROW );

  /* Odd rows have unique nameset */
    rownames[0] = ODDROW;
    rownamelist.number = 1;

    paddnameset( &rownamelist );
    ppsetpickhighlightindex ( 1 );
    for( i = 1; i < 10; i++) 
        {
        displace.x = i*0.1;
        ptranslate3( &displace, &xerror, xform );
        psetlocaltran3( xform, PREPLACE );
        pexecutestruct( i%2 ? ODDMARK : EVENMARK );
        };
    premovenameset( &rownamelist );
    pclosestruct();
    popenstruct( EVENROW );

  /* Even rows have a unique nameset */
    rownames[0] = EVENROW;
    rownamelist.number = 1;

    paddnameset( &rownamelist );
    ppsetpickhighlightindex ( 2 );
    for( i = 1; i < 10; i++) 
        {
        displace.x = i*0.1;
        ptranslate3( &displace, &xerror, xform );
        psetlocaltran3( xform, PREPLACE );
        pexecutestruct( i%2 ? ODDMARK : EVENMARK );
        };
    pclosestruct();


 /* Root structure */
    displace.x = 0.0;
  popenstruct( TOP );
    plabel(VIEWLABEL);
    for( i = 1; i < 10; i++) 
        {
        displace.y = i*0.1;
        ptranslate3( &displace, &xerror, xform );
        psetglobaltran3( xform );
        pexecutestruct( i%2 ? ODDROW : EVENROW );
        };
     pexecutestruct(SQUARE);

   pclosestruct();
   ppoststruct( WSID, TOP, 1.0 );
   pupdatews( WSID, PPERFORM );
   return 1;
}





ReportPick(pickptr)
Pqpick *pickptr;
{
    int i;

    if (pickptr->status == PQP_OK) {
	for(i = 0; i < pickptr->pick.depth; i++)
	    fprintf(stderr, 
		    "i = %d struct_id = %d pick_id = %d el_num = %d\n",
		    i,
		    pickptr->pick.pick_path[i].struct_id,
		    pickptr->pick.pick_path[i].pick_id,
		    pickptr->pick.pick_path[i].el_num);
    }
    else {
	fprintf(stderr, "Missed\n");
    }
}





                 reply	other threads:[~1994-04-27 21:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox