Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    11
  • comments
    11
  • views
    13054

D3D 10

Sign in to follow this  
Monder

554 views

Well the December 2005 update to the DX SDK came out a few days ago, and you're probably aware it came with a preview of D3D 10 which will run on Vista using the reference device (no actual hw is available yet unfortunately). D3D 10 is quite a big change from D3D 9, the entire API has been revamped. Here's an image of the pipeline in D3D 10 taken from the docs (note that the fixed function pipeline has been eliminated in D3D 10).



The rounded boxes indicate programmable stages. IMO the most notable things on this diagram are the geometry shader, the stream output stage and the memory resources block. Lets examine these things in turn.

The memory resources block

In D3D 10 memory has become unified, you basically have two resource types, buffers and textures (there are several different types of textures) and these resources can be accessed by any shader. Buffers are generally used for vertex data and index data. You also have a new concept called constant buffers. These are, as the name suggests, buffers of constant data which replace constant registers as used in D3D 9 shaders. An interesting addition to textures is texture arrays. That is in a shader you can access an array of textures (the textures in an array must be homogeneous, that is they share the same format, resolution and number of mip levels) indexed by an integer. Resources are accessed by the hardware using views. A view describes the way in which the hardware sees the resource and it is the resource view that you bind to the pipeline.

The geometry shader

A geometry shader works on per-primitive data instead of per-vertex data as in the vertex shader. It receives the data for a full primitive in it's inputs and can then add vertex data to a stream which is then ouput. Thus you can create new geometry or block a primitive from being rasterized using a geometry shader.

The stream output stage

This allows you to write data from a geometry shader back into a buffer resource without rasterizing the data. You can then read this data back into the pipeline in another rendering pass or use what is known as a staging resource to read this data back to the cpu. This has applications in things like GPU particle systems and physics. You can update the system using a vertex and geometry shader in one pass writing the resulting data back out to a buffer using the stream output stage and then render in the next pass.

Another notable thing not indicated on the diagram is that there is now a unified shader core and an unlimited instruction length in shaders, also shaders are now written in HLSL only. The unified shader core means all shaders can perform the same operations though there are certain instructions that only make sense in a particular shader stage (e.g. Operations on a geometry stream in a geometry shader and discarding a pixel in the pixel shader stage). Shader semantics have also altered. Now instead of having a fixed set on constant semantics you can name them whatever you want (the names are given in the input layout for a buffer, the D3D 10 equivalent of vertex declarations). There is a set of semantics known as system values that have a special meaning. Some of these system values give per vertex and per primitive data that identifies a vertex or primitive to a vertex or geometry shader these identifiers are just sequential numbers generated at the input assembler stage (i.e. The first vertex is numbered 0, the second 1, the primitives are numbered in a similar way). Others allow you to set the index of the render target something is rendered to, and others are the equivalent of semantics in D3D 9 (the SV_Position semantic is the equivalent of POSITION and the SV_Target semantic is the equivalent of COLOR). Shaders also now have an integer data type and allow bitwise operations on integers.

Textures are handled differently in D3D 10 shaders compared to D3D 9. A sampler is now a single object that is not bound to any particular texture. The sampler object describes things like how to filter the texture. You then sample a texture giving texture coordinates and a sampler object. The syntax used has also changed. Textures are know treated as templated objects. Which works like this:

Texture2D tex;
sampler samp;
...

tex.Sample(samp, TexCoord);

There's still a lot more to D3D 10 but hopefully the above has given you a sample of the new things found in D3D 10, if you want to learn more I refer you to the D3D 10 docs, and these two articles written by Jack Hoxely (jollyjeffers) Beginning Direct3D 10 programming and An Overview of Microsoft's Direct3D 10 API.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!