XGL Device Pipeline Porting Guide
只搜寻这本书
以 PDF 格式下载本书

............................Contents


Preface
xxi

New Features
xxv

1. Introduction to XGL Loadable Interfaces
1
...Introduction to the XGL Product 1
......Solaris Dynamic Linking 2
...XGL Loadable Interfaces 2
......Loadable Interface 1 (LI-1) 3
......Loadable Interface 2 (LI-2) 3
......Loadable Interface 3 (LI-3) 3

2. Getting Started
7
...Before You Begin 8
......Requirements 8
......OpenWindows and XGL 9
......Device Support for Multiple XGL Contexts 9
......Device Support for Backing Store 10
...XGL Architecture from the Pipeline Point of View 11
......More on Device Pipelines 11
......Services the XGL Core Provides the Device Pipeline 12
...Porting Task 14
......Choosing a Loadable Interface Level 14
......A Quick Look at Implementing an LI-1 Primitive 16
......Testing Your Implementation 20
...Calling the Software Pipeline 20
......Device Pipeline Options to Rendering Calls 20
...What Else You Should Know 21
......Accessing External Files at Runtime 21
......Directory Structure for the XGL DDK 22
......Error Reporting for XGL Device Pipelines 23

3. Pipeline Framework
29
...Overview of the Pipeline Framework 30
...Setting Up the Pipeline Framework 32
......Defining xgl_create_PipeLib() 32
......Defining the Device Pipeline Library Class 33
......Defining the Device Pipeline Manager Class 36
......Defining the Device Pipeline Device Class 38
......Defining the Device Pipeline-Context Class 43
......Naming Your Device Pipeline 51
...Optional Functions in Device-Dependent Classes 52
......Overridable Functions in DpDev.h 52
......Overridable Functions in DpDevRaster.h 53
......Overridable Functions in DpDevWinRas.h 54
......Overridable Functions in DpDevMemRas.h 56
...What Else You Should Know 58
......How a Device Pipeline Is Loaded 58
......Device Pipeline Objects for Multiple Processes 59
......Adding Member Data to a Pipeline Class 61
......Versioning 63
......Backing Store Support in the Pipeline Classes 65
......Quick Reference Chart of Overridable Functions 68

4. Internal Data Storage
73
...Internal Data Types 74
...Accessing Data at the LI-1 Layer 75
......Accessing Application Data 75
......Accessing Facet Data 76
......Point Lists with Data Mapping Values 77
......Data Access for DMA Devices 78
...How Data Is Stored by the Software Pipeline 79
......Data Storage in the XglLevel Object 80
...LI-2 Point Data 82
......Accessing Data at the LI-2 Layer 82
......Pipeline Interfaces to XglPrimData and XglLevel Data 84
...Conic and Rectangle Data 85
......Accessing Rectangle Data from XglRectData 85
......Accessing Conic Data from XglConicData 86
......Pipeline Interfaces to XglConicData and XglRectData 88
...Pixel Data 89
......Using PixRects 90
......PixRect Interfaces 91

5. Handling Changes to Object State
95
...State Changes and the Device Pipeline 96
...Getting Attribute Values from the Context Object 96
......When the Device Associated with a Context Is Changed . 98
...Getting Attribute Values from Objects Other Than the Context 99
......Handling Derived Data Changes 105
...Getting Stroke Attribute Values from the Stroke Group Object 106
......Example of Device Pipeline Use of Stroke Groups 107
......Rendering Multipolylines 109
......Flag Mask and Expected Flag Value 111
......DC Offset 112
...Design Issues 114
......Deciding to Reject a Primitive 114
......Handling Context Switches 115
......Handling Changes in LI Levels 116
......Partial Rendering of a Primitive 117

6. Getting Information from XGL Objects
119
...What You Should Know About XGL Attribute Values 120
......Naming Conventions for Internal Attributes 121
......Context Attributes and LI Layers 122
...Getting Attribute Values from the Context 123
...Getting Attribute Values from Other Objects 123
...Getting Information from a Transform Object 125
...Getting Attribute Values From the Stroke Group Object 125
...Non-API Interfaces Provided in API Objects 127
......Context Interfaces 127
......Context 2D Interfaces 128
......Context 3D Interfaces 129
......Data Map Texture Interfaces 130
......Device Interfaces 131
......Light Interfaces 132
......Line Pattern Interfaces 132
......Marker Interfaces 133
......MipMap Texture Interfaces 133
......Raster Interfaces 134
......Texture Map Interfaces 134
......Window Raster Interfaces 135
......Memory Raster Interfaces 135
......Stroke Font Interfaces 136
......Transform Interfaces and Flags 137
...Getting Information From the Device Object 145
......Color Map Interfaces 145

7. View Model Derived Data
149
...Overview of View Model Derived Data 150
......Design Goals of Derived Data 151
...Derived Data Items 154
...... Coordinate Systems and Transforms 154
...... Other Derived Items 156
...Overview of Derived Data's Implementation 157
...Accessing Derived Data 158
...Registration of Concerns 159
......Bit Definitions for the View Flag 161
...Determining Whether Derived Items Have Changed 163
......Messages 163
......The Composite 164
......Detecting Changes With the Composite 164
......Setting the Composite 165
......Clearing the Composite 165
......Detecting Changes to Individual Derived Items 166
...Getting Derived Items 168
...... Getting Derived Transforms 169
...... Getting Boundaries 170
...... Getting 3D Viewing Flags 171
...... Getting Lights 172
...... Getting Eye Positions or Vectors 173
...... Getting Model Clip Planes 174
...... Getting Depth Cue Reference Planes 175
...Example of Detecting Changes and Getting Derived Items 175
...Current Coordinate System 180

8. Window System Interactions
183
...Overview of the XglDrawable 184
......Services Provided by XglDrawable Class 185
...A Typical Scenario of Drawable Creation and Use 186
...What You Should Know About Locking the Window 187
...Drawable Interfaces for the Pipeline 189
......Obtaining Information During Pipeline Initialization 190
......Accessing Dynamic Information Through the Drawable 191
......Managing Window System Resources 195
......Managing Software Cursors 196
...Description of Drawable Interfaces 197
......XglDrawable Functions for the Device Pipeline 197
......XglDrawable Functions Used by the XGL Core Only 203
......Window System Dependencies 205

9. Writing Loadable Interfaces
207
...What You Need to Know about the Loadable Interfaces 208
......Overview List of Loadable Pipeline Interfaces 209
......Deciding Which Interfaces to Implement 211
......Input Data for LI-2 and LI-3 214
......Picking 214
......Hints for Rendering Transparent 3D Surfaces 215
......Calling the Software Pipeline for Texture Mapping 216
......Antialiasing and Dithering 218
......Mapping of API Primitive Calls to LI-1 Functions 218
...What You Should Know about the Software Pipeline 220
......Software Pipeline Multiplexing 220
......Software Pipeline Backing Store 221
......Surface Color in the Software Pipeline 221
......Texture Mapping in the Software Pipeline 222
...LI-1 Functions 223
...... About the LI-1 Layer 223
......LI-1 Operations in the Software Pipeline 223
...... Mapping of LI-1 to LI-2 Functions in the Software Pipeline 224
......LI-1 Attributes 226
......li1AnnotationText() - 2D/3D 227
......li1DisplayGcache() - 2D/3D 229
......li1MultiArc() - 2D 250
......li1MultiArc() - 3D 252
......li1MultiCircle() - 2D 254
......li1MultiCircle() - 3D 256
......li1MultiEllipticalArc() - 3D 258
......li1MultiMarker() - 2D 260
......li1MultiMarker() - 3D 261
......li1MultiPolyline() - 2D 263
......li1MultiPolyline() - 3D 264
......li1MultiRectangle() - 2D 266
......li1MultiRectangle() - 3D 267
......li1MultiSimplePolygon() - 2D 269
......li1MultiSimplePolygon() - 3D 270
......li1NurbsCurve() - 2D 272
......li1NurbsCurve() - 3D 274
......li1NurbsSurf() - 3D 276
......li1Polygon() - 2D 278
......li1Polygon() - 3D 280
......li1QuadrilateralMesh() - 3D 282
......li1StrokeText() - 2D/3D 283
......li1TriangleList() - 3D 285
......li1TriangleStrip() - 3D 288
......li1Accumulate() - 3D 290
......li1ClearAccumulation() - 3D 292
......li1CopyBuffer() - 2D/3D 293
......li1Flush() - 2D/3D 297
......li1GetPixel() - 2D/3D 298
......li1Image() - 2D/3D 299
......li1NewFrame() - 2D/3D 301
......li1PickBufferFlush() - 2D/3D 303
......li1SetMultiPixel() 305
......li1SetPixel() - 2D/3D 306
......li1SetPixelRow() - 2D/3D 307
...LI2 Functions 308
......About the LI-2 Layer 308
......LI-2 Surface Attributes 308
......Mapping of LI-2 Functions to LI-3 Functions in the Software
........Pipeline 310
......li2GeneralPolygon() - 2D/3D 312
......li2MultiDot() - 2D/3D 313
......li2MultiEllipse() - 2D 314
......li2MultiEllipticalArc() - 2D 315
......li2MultiPolyline() - 2D 316
......li2MultiPolyline() - 3D 318
......li2MultiRect() - 2D 320
......li2MultiSimplePolygon() - 2D 321
......li2MultiSimplePolygon() - 3D 322
......li2TriangleList() - 3D 323
......li2TriangleStrip() - 3D 324
...LI-3 Functions 325
......About the LI-3 Layer 325
......Notes on Implementing LI-3 Functions 326
......li3Begin() and li3End() - 2D/3D 328
......li3CopyFromDpBuffer() - 2D/3D 329
......li3CopyToDpBuffer() - 2D 330
......li3CopyToDpBuffer() - 3D 331
......li3MultiDot() - 2D 333
......li3MultiDot() - 3D 334
......li3Vector() - 2D 336
......li3Vector() - 3D 338
......li3MultiSpan() - 2D 341
......li3MultiSpan() - 3D 343

10. Utilities
347
...RefDpCtx 348
......Using RefDpCtx 349
......RefDpCtx Interfaces 351
...3D Utilities 352
...Bounding Box Utilities 397
...Copy Buffer Utilities 399
...Polygon Classification Utilities 403
...Polygon Decomposition Utilities 405

A. Performance Tuning
409
...Finding the Performance Critical Paths 410
......At-a-Glance Comparison of Performance Tools 412
......Recommendations for Performance Tools 413
...Selecting Good Benchmarks 413
...Tuning Performance Critical Paths 415
......Locating the Central Body of Code 415
......Changing the Underlying Algorithm 415
......Tuning at the Assembly Language Level 416
...Tips and Techniques for Faster Code 416

B. Changes to the XGL Graphics Porting Interface
439
...Changes in Rendering Architecture 439
...Changes in State Handling 442
...Application Data Passed Directly to Pipelines 443

C. Accelerating NURBS Primitives
445

Index
447