Sam Glassenberg continued

Using constant buffers in D3D10

Sam gave insight into using D3D10 constant buffers, to help maximise performance and minimise coder effort. A good way to use them is per-frequency in your app. So if you have constants that change per-level, or per-frame, keep around a separate CB for each frequency change. While CBs can be huge, they can be cached on chip, so obviously reasonable sizes work best.

FXC10

fxc10.exe, the new standalone HLSL compiler, is leaner, leveraging the new runtime for performance reasons. FX10, the related effects framework to let developers do common tasks simpler and easier, also gets a similar workover in terms of performance.

The compiler will eventually provide support for shader reflection as defined by the API, letting programs interrogate others for interfaces, presumably so shaders can somewhat self assemble and chain.

Predicated rendering

D3D10 provides API support for occlusion-tested rendering, allowing you to ask the GPU based on bounding geometry, whether something will be hidden by what's been drawn already. That occlusion query (D3D10_QUERY_OCCLUSION_PREDICATE) lets you predicate rendering, saving you cycles and on-chip bandwidth, and it gives you scope for LOD-based predication one would suppose, if you're able to ask the GPU what it's drawing.

Last bits

Sam finished off his presentation by saying DirectX 10.1 would come fairly soon after Vista's launch, and threw out indexable cube maps as something to look forward to. There'll be a cap per DX10 revision, Sam said, letting developers check against the new base feature set in further DX10 revisions.

He was also fairly confident that since performance scaling is the big differentiator for hardware in D3D10, rather than features, that more performance info would be exposed to applications via the display driver. Your author, as well as being happy that there'll be more ways to ask the hardware what it's doing, invisages a time where real-time profiling could one day provide automatic, granular, game scaling based on CPU and GPU information, rather than providing pre-tuned steps that don't always map well to the underlying PC hardware.

Something to integrate with WinSAT maybe, down the road.

Summary

A good intro to some of the good bits about D3D10, despite it being pretty much a slide deck already shown at GDC. It always helps to have someone vocalise and demonstrate concepts ahead of you using them, so you have a somewhat concrete idea of what to do with them, and Sam's good at that.

If Microsoft are reading, wheel him out to more developers!