Getting Started Writing XGL Device Handlers
  Search only this book
Download this book in PDF

Building the Reference Pipelines

2

This chapter describes how to build the reference XGL device pipelines provided with the XGL DDK product. Although building the reference pipelines is not required, you may want to build one or more pipelines to check that the DDK product and the compilers have been properly installed.

Reference Pipelines Provided with the XGL DDK

Source code for the reference pipelines listed in Table 2-1 is provided with the XGL DDK as examples of XGL device pipelines. The reference pipelines are located in /opt/SUNWddk/ddk_2.5.1/xgl/src/dd.
Table 2-1
NameDescriptionFeatures
cfbSPARC simple color frame buffer pipeline (CG3/CG8)8-bit or 24-bit unaccelerated DGA rendering. Uses RefDpCtx for rendering.
cg6SPARC TGX frame buffer pipelineExample of an LI-1 8-bit color DGA pipeline. Accelerates 2D solid and patterned lines, simple polygons without holes, and multisimple polygons. Accelerates 3D solid and patterned lines, solid simple and multisimple polygons, and flat-shaded, non-Z buffered triangle strips.
cgmCGM pipelineOutputs CGM formatted files.
Table 2-1 (Continued)
NameDescriptionFeatures
memMemory pipelineRenders primitives to host memory.
p9000x86 pipelineExample of an LI-2 8-bit pipeline. Accelerates 2D and 3D lines and 3D multisimple polygons, regular polygons, triangle strips, and quad meshes. Also accelerates LI-3 spans.
p9100x86 and PowerPC(TM) pipelineExample of an LI-2 8-bit pipeline. Accelerates 2D and 3D lines and 3D multisimple polygons, regular polygons, triangle strips, and quad meshes. Also accelerates LI-3 spans.

Software Prerequisites

Before you build the XGL reference pipelines, you must have the Solaris environment installed. In addition, the XGL runtime and XGL SDK packages must be installed. If these packages have been installed to the default locations, you can determine whether the necessary files are available as follows:
  • For the XGL runtime libxgl.so, check the directory /opt/SUNWits/Graphics-sw/xgl/lib.
  • For the XGL SDK include files xgl*h, check the directory /opt/SUNWsdk/sdk_2.5.1/xgl.

Note - The cg6 pipeline depends on header files that are included in the Solaris Sample Device Drivers package (SUNWDrvs). This package must be installed on your system before the cg6 pipeline can be built.


Note - In Solaris 2.5.1, the XGL include files do not reside in the same directory as the runtime binary. However, a symbolic link from /opt/SUNWits/Graphics-sw/xgl/include/xgl to /opt/SUNWsdk/sdk_2.5.1/xgl/include/xgl is created when the SDK packages are installed. As a result, the XGLHOME environment variable works as in previous releases.

Space Requirements

The reference pipelines can require up to 4 Mbytes of disk space, depending on the number of pipelines you build. Table 2-2 shows the approximate amount of space needed for each pipeline.
Table 2-2
PipelineSize
mem305K
cfb272K
cg62.3 Mbtyes
cgm580K
p9000500K
p9100500K

Steps for Building the Reference Pipelines

Follow the steps below to build the reference pipelines.
  1. As super-user, run the change_owner script to change owner on the include, src, and lib directories so that the directories are owned and writable by the user who will perform the build.


  # <DDK_DIR>/bin/change_owner [owner] [group]  

  1. Exit root login and become user.

  2. Set the $XGLHOME environment variable to point to the directory where the XGL runtime and include files are located.

    The default installed location is /opt/SUNWits/Graphics-sw/xgl.


  % setenv XGLHOME <XGL runtime directory>  

  1. Change directory to the directory where the XGL DDK package is installed.

    The default location is /opt/SUNWddk/ddk_2.5.1/xgl.


  % cd <DDK_DIR>  

  1. Run the setup_links script.

    The setup_links script adds links in the DDK lib directory that point to the XGL runtime library, the software pipeline, and the stroke font files.


  % bin/setup_links  

  1. Set the required environment variables to point to the appropriate locations, as follows:

  • Set the $XGLHOME environment variable to point to the <DDK_DIR> directory.
  • Set the $LD_LIBRARY_PATH environment variable to point to the location of the XGL library and the OpenWindows libraries.

  % setenv XGLHOME <DDK_DIR>  
  % setenv LD_LIBRARY_PATH $XGLHOME/lib:$OPENWINHOME/lib  

  1. In the file mk_cc_defs.include, edit the lines CC5 and CCC5 for the appropriate hardware architecture so that the macros point to the location of the ANSI C compiler and C++ compiler on your system. For example, on SPARC hardware running in the Solaris 2.x environment, you edit the lines as follows:


  CC5-sparc = /opt/SUNWspro/SC2.0.1/acc  
  CCC5-sparc = /opt/SUNWspro/SC2.0.1/CC  

  1. Change directory to the src directory.

  2. Execute the make opt command to build the reference pipelines. The Makefile builds the pipelines for the architecture you are running on and places the pipeline binaries in the <DDK_DIR>/lib/pipelines directory.

To build a single pipeline, execute the make opt command from the <DDK_DIR>/src/dd/<pipeline> directory. Note that the skeleton pipeline is intended as a template for your device pipeline; do not build the skeleton pipeline at this time. Note also that at compile time, the cfb pipeline requires several memory pipeline object files; therefore, you need to build the memory pipeline before building the cfb pipeline.
If no "Fatal Error" messages are displayed, the pipeline builds are complete.