Shader models 2.0a-2.0b and DirectX 9.0a-9.0b?

eddman

Newcomer
There aren't really any concrete sources on this, and some even contradict each other. Looking through Microsoft's online shader documentations, they apparetnly only list versions 2.0 and 2.x.

AFA I can tell, 2.0a is used to refer to the extended shader abilities of Geforce FX, and 2.0b for Radeon X*00 series.

Are these actual shader models? If so, were they introduced with DX 9.0a and 9.0b, or existed from the initial DX9 release?

Also, did MS come up with them first, or released these DX versions retroactively, based on the features nvidia and ATI implemented on their GPUs?
 
I thought maybe looking around in the SDKs might reveal something. I downloaded the initial 9.0 SDK from 2002 and there are references to even model 3.0 in the docs!

So were these already included from day one?

Each DX9 release's d3d9.dll file has a different version though. What does that indicate?
 
That was like the wild west 20 years ago. And DX9 was moving along with every new GPU release:
First with ATi's R300 and FP24 for pixel shaders and SM 2.0b.
Second with nVidia's CineFX v1 (5000 series) with FP16 and FP32 for pixel shaders and SM2.0a.
Third with nVidia's CineFX v2 (6000 and 7000 series) with SM3.0.
Fourth with AMD's X1800 and X1900 cards supporting SM3.0

Anandtech has a good explanation of R300 and CineFX v1:
Vertexshaders
vs20.gif


Pixelshaders
ps20.gif

cinefx.gif


A few informations about SM3.0: https://www.anandtech.com/show/1293/2
 
Yea, I've read those articles. I'm just wondering if SM2.0a/b were specific models provided by DX or not, and if DX9.0a/b correspond to them at all. I'm starting to think they are not and that the info on, say, wikipedia is wrong.

Based on the SDK doc, it seems you can create a shader model 3 game even with the initial DX 9.0, without needing the later DX9 a/b releases.

I'm not a coder or graphics expert, so it's likely I'm just misunderstanding the SDK. Could it be they were just placeholder specs and weren't implemented in the actual initial d3d9.dll yet?
 
Based on the SDK doc, it seems you can create a shader model 3 game even with the initial DX 9.0, without needing the later DX9 a/b releases.
IIRC 2.0, 2.0.a and 3.0 models were launched with the initial DX9 release.
2.0.b was added with a DX9.b update though.
 
[edit] It seems like a documentation quirk, where in one place they use 2.x as a synonym to 2.0a, and in other parts they specifically refer to 2.0a and 2.0b.

ps_2_x / vs_2_x profiles are listed in the Direct3D9 programming reference, however the FXC offline compiler tool and realtime D3DCompile / D3DXCompileShader functions always used ps_2_a / vs_2_a and ps_2_b profiles, as defined by D3DXGetPixelShaderProfile and D3DXGetVertexShaderProfile functions.

This applies to both HLSL ("High-Level Shading Language"), derived from Nvidia Cg, and the legacy "Shader Assembly Language", though HLSL / Cg source code was far more popular and it's compiled into the same assembly language bytecode for the video card driver to execute.



Hardware support for shader models 2.0a and 2.0b was added in respective SDK/runtime releases shipped with Direct3D 9.0a and 9.0b in March and August 2003 respectively. The original Direct3D 9.0 SDK and redistributable runtime from December 2002 only supported shader model 2.0, while shader model 3.0 was added by Direct3D 9.0c in July 2004.

 
Last edited:
Thank you. I didn't know what to look for on MS docs so I was only finding 2.x references. Once you mentioned the actual names, ps_2_a, etc. they started to show up in search results.

The original Direct3D 9.0 SDK and redistributable runtime from December 2002 only supported shader model 2.0, while shader model 3.0 was added by Direct3D 9.0c in July 2004.

I still don't know why there are references to shader model 3.0 in the 9.0 SDK from 2002. Was it just a draft for the future GPUs, considering that the first compliant models showed up in 2004?
 
Was it just a draft for the future GPUs, considering that the first compliant models showed up in 2004?
Yes, it includes relevant documentation and a shader compiler preview so the developers could test the upcoming shader model 3.0.

These are "software" profiles vs_3_sw / ps_3_sw (and vs_2_sw / ps_2_sw for shader models 2.0) though, so they are only supported by the reference rasterizer device typically used for debug and validation. Hardware profiles were added later with subsequent SDK/runtime releases.

BTW software vertex shaders could also run in realtime, often beating slower shader model 2.0 hardware on fast CPUs!


I didn't know what to look for on MS docs so I was only finding 2.x references

Well, on a more thorough look through the offline documentation in historical DirectX SDK releases, FXC offline shader compiler and realtime D3DCompile / D3DXCompileShader have always used ps_2_a / vs_2_a and ps_2_b profiles passed as a text string, while the Direct3D SDK programming documentation refers to '2.0 extended' profiles ps_2_x / vs_2_x and there are D3DCAPS9 structures D3DPSHADERCAPS2_0 / D3DVSHADERCAPS2_0 which define a few optional hardware features and variables PixelShaderVersion / VertexShaderVersion that contain the main / sub versions as integers.

Nvidia Cg 3.1 Toolkit documentation also uses ps_2_x / vs_2_x profiles for GeForce FX/PCX hardware (but completely omits ps_1_0/ vs_1_0 and ps_1_4, ps_2_a / vs_2_a and ps_2_b, and ps_4_1 / vs_4_1 / gs_4_1, in Nvidia's typical manifestation of "not invented here" syndrome).


So it seems like these "2.0 extended" profiles are leftovers from the initial Cg toolset and documenation, patched over existing Direct3D shader assembly programming reference, and these are equivalent to 2.0a profiles in the actual Direct3D compiler toolset.
 
Last edited:
9.0 - 2.0 -> initial Microsoft specification
2.0a -> NVIDIA: here I comes, my FX5xxx turbo vacuum chamber noise can do moar!
2.0b -> ATI: actually I can do something better than 2.0 (and even on old cards, even on 9000 series and their slower refresh) too but not like nvidia (sigh!).. almost (there should be something they are "better" on vertex shaders maybe?
9.0c - 3.0 -> surprise! this mode will be forgotten in few years but all fight about what means "full support" (hint: x1x00 of ATI had a lack or 2.. I don't remember now)
10.0 -> 9.0d.. wait better calling it 9.0L for Longhorn.. no wait it's just a dwm extension, so let it be "9.0ex" -> Microsoft: DWM and flip support for old cards shader models.. but old cards needs a proper driver! We will updated it with DX11 and Windows 7 since we like to make a mess!
10.1 -> 9_0, 9_1 and 9_2 Microsoft: backsupport of SM 2.0 iterations (sort of) with something back from 3.0 (but we don't support it! 3.0 is trash!)... yet again needed a proper driver, hoping to boost old cards using MS store trash platform

btw I would not use the software/reference mode for VS, was meant more for the 8.x -> 9.0 translation
 
Last edited:
Back
Top