AMD DirectX Optimizations - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

AMD DirectX Optimizations

Description:

The optimizations for DX5-DX7 for this fixed function pipeline mainly take ... Vertex Shader Software Rendering ... void XformU(float *r, float *V, Mat M) ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 18
Provided by: kaitly
Category:

less

Transcript and Presenter's Notes

Title: AMD DirectX Optimizations


1
AMD DirectX Optimizations CodeAnalyst
  • Howard Dortch

2
AMDs Optimizations of DirectX for AMD Processors
  • Fixed Function Pipeline (since DX5)The
    optimizations for DX5-DX7 for this fixed function
    pipeline mainly take advantage of 3DNow! SIMD
    over the reference C implementation which
    compiles to x87.
  • Vertex Shader Software Rendering Pipeline (since
    DX8)
  • D3DX Library (about 60 of the more important
    functions)

3
MSSDK Vertex Shader run without optimizations
4
MSSDK Vertex shader run with optimizations
5
Introduction to CodeAnalyst
  • CodeAnalyst helps programmers find slow code and
    gives hints as to how to make it run faster on
    AMD processors. It does this using a Timer Based
    Sampler to show what part of the code is getting
    hit the most. Then it allows the user to take a
    closer look at an area of interest by simulating
    the code.
  • TSIM - The Trace Simulator included in
    CodeAnalyst was designed to allow the user to
    simulate code on all AMD processors regardless of
    the machine used for testing.

6
What Needs Optimization?
  • Servers - The online gaming industry is growing
    fast. Game servers have to do a lot of
    calculations.
  • Games - Video games are becoming more complex.
    Game designers have to write software for high
    end and low-end graphics cards. No matter how
    powerful, the graphics cards, or the API,
    designers will push the limits.
  • Streaming video - Moving large quantities of data
    through a computer is processor and memory
    bandwidth intensive.
  • Math intensive programs - Any software that moves
    data and performs math functions on the data is a
    candidate for optimization.

7
CodeAnalyst Demo
  • MSVC build in release mode with debug info.

8
CodeAnalyst Demo
  • MSVC build in release mode with debug info
    (cont).

9
Setup CodeAnalyst project
  • Starting a new project is easy, just follow the
    path to the exe file in the release directory and
    click on it. You can then select any special
    dlls or pass parameters.

10
Timer Based Profiling is easy just click the
button!
11
Using the Trace Simulator
  • Set start point

12
Using the Trace Simulator
  • set end point

13
Using the Trace Simulator
  • And GO!

14
Using the Trace Simulator
  • Getting results

15
Code Sample 1
  • /
  • Xform
  • THIS FUNCTION SHOWS AN UNOPTIMIZED FUNCTION

  • /
  • void Xform(float r, float V, Mat M)
  • for (int i0ilt4i)
  • ri0
  • for (int j0jlt4j)
  • riMjiVj

16
Code Sample 2
  • /
  • XformU
  • THIS FUNCTION IS OPTIMIZED BY UNROLLING THE LOOP

  • /
  • void XformU(float r, float V, Mat M)
  • r0 M00 V0 M10 V1 M20
    V2 M30 V3
  • r1 M01 V0 M11 V1 M21
    V2 M31 V3
  • r2 M02 V0 M12 V1 M22
    V2 M32 V3
  • r3 M03 V0 M13 V1 M23
    V2 M33 V3

17
Final Slide
  • The AMD Code Optimization Guide has lots of good
    information
  • www.amd.com/products/cpg/athlon/techdocs/
  • AMD Developers Connection
  • www.amd.com/devconn
  • More info on CodeAnalyst can be found at
  • www.amd.com/devconn/3dsdk/canalyst.html
  • Visit the AMD Suite
  • Email howard.dortch_at_amd.com
Write a Comment
User Comments (0)
About PowerShow.com