Download presentation
Presentation is loading. Please wait.
Published byConstance Park Modified over 9 years ago
1
Pipeline Optimization Real-Time Rendering 2002. 5. 22 김 송 국
2
Optimization Application Stage Geometry Stage Rasterizer Stage Overall Optimization Locating the Bottleneck Testing the Application Stage Testing the Geometry Stage Testing the Rasterizer Balancing the Graphics Pipeline Host and Accelerator Multiprocessing Multiprocessor Pipelining Parallel Processing Content
3
Three Conceptual Stage Application, Geometry, and Rasterizer Based on a pipelined architecture One of these stages will always be the bottleneck A prime candidate for optimization Optimizing the performance of the rendering pipeline ; process of optimizing a pipeline processor (CPU) i) Bottleneck of the pipeline is located ii) Optimized in someway Two stage become the bottleneck again
4
Locating the Bottleneck The first step in optimizing a pipeline Not easily done Simply by timing the process Another approach would be to clock the individual stages (set up a number of test) Each test only affects one stage at a time Testing the Application Stage Testing the Geometry Stage Testing the Rasterizer Stage
5
Testing the Application Stage Test for CPU limits Measuring the workload on the CPU processor(s) Does not change the workload on the CPU Send down data that causes the other stages to do little or no work Ex) OpenGL Replacing all glVertex3fv+ and glNormal3fv call with glColor3fv calls
6
Testing the Geometry Stage Most difficult stage to test Workload on this stage is changed The workload on one or both of the other stages is often changed Type and number of light sources
7
Testing the Rasterizer Stage The easiest and fastest to test Simply decrease the resolution of the window Not affect the application stage or the geometry stage
8
Optimization Optimize that stage to boost the performance Optimizations trade off quality for speed
9
Optimization (1)Application Stage Techniques of the Two Optimization ; Making the code and the memory accesses Making the Code The basic rule of optimization to try a variants ; Reexamine algorihms, assumptions, and code syntax, trying as many variants as possible Write the fastest code (Limit the user's ability) Memory Accesses ; Memory accesses of the program faster
10
Optimization (1)Application Stage Code Issues Avoid using division as much as pollible Unroll small loops in order to get rid of the loop overhead Math functions are expensive and should be used with care Use inline code for small functions that are frequently called Lower floating-point precision when reasonable Use const whenever possible
11
Optimization (1)Application Stage Memory Issues Memory that is accessed sequentially in the code ; Stored sequentially in the memory Try to exploit the cache(s) of the architecture Cache prefetching Avoid pointer indirection, jumps, and function calls
12
Optimization (2)Geometry Stage Responsible for Transforms, Lighting, Clipping, Projection and Screen Mapping Process that can be optimized relatively easily Transforms & Lighting Memory Accesses ; Memory accesses of the program faster
13
Overall Optimization Reduce the total number of drawing primitives Choose as low a precision as is possible Preprocess the models for redering in your prrtioular context Turn off feature not in use Minimize state changes by grouping objects (texture, material, lighting, transparency, etc.) Spparate two-dimensional from three-demensional operations Call glGet() during the set-up phase and avoid it during runtime
14
8.3 Balancing the Graphics Pipeline 8.4 Host and Accelerator 8.5 Multi processing 8.5.1 Multiprocessor pipelining 8.5.2 Parallel Processing
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.