Direct3D 11.3 and SM 5.1?

Started by
5 comments, last by Hodgman 7 years, 8 months ago
tldr; Shouldn't a ID3D11Device3 be able to load a vs_5_1 shader?
I'd like to make use of Dynamic Indexing which was made possible in SM5.1 - https://msdn.microsoft.com/en-gb/library/windows/desktop/mt186614(v=vs.85).aspx
As far as I can tell SM5.1 is available (at least partially?) in D3D11.3 - https://msdn.microsoft.com/en-us/library/windows/desktop/dn933277(v=vs.85).aspx
However if I
  • write a simple vertex shader
  • compile it using fxc to a file (with /T vs_5_1)
  • then load that using ID3D11Device3::CreateVertexShader, it reports: D3D11 ERROR: ID3D11Device::CreateVertexShader: Shader must be vs_4_0, vs_4_1, or vs_5_0. Shader version provided: UNRECOGNIZED [ STATE_CREATION ERROR #167: CREATEVERTEXSHADER_INVALIDSHADERTYPE]
I'm using; Windows SDK 10.0.14393, d3dcompiler_47, fxc 10.1, D3D_FEATURE_LEVEL_11_1, 970GTX with driver 372.54, VC++ 14
Advertisement

Long shot: Try creating the device with D3D_FEATURE_LEVEL_11_3; if the enumeration is not present in your headers use the value 0xb300

There is no feature level 11.3, but FL12 and FL12.1 exist. I don't think that D3D11.3 actually supports SM5.1, despite what the docs say. Let me double-check...

Edit: Just confirmed:


// SM 5.1 becomes available via the DX12 API only

Cheers Jesse :)

I found dxcapsviewer.exe in the Windows SDK which has also clarified a few things -

Direct3D 11.3 > FL_11_1, FL_12_0 and FL_12_1 = Shader Model 5.0

Direct3D 12 > FL_11_0, FL_11_1, FL_12_0 and FL_12_1 = Shader Model 5.1

Guess it's time to bite the bullet and do the big upgrade to 12 :o

Why do you need dynamic indexing? Most of the time you can get away with indexing const/Tex buffers and texture arrays. Is there something in particular you want to achieve?

I've packed all my various textures that are used in my 3d scene into a set of texture arrays. A texture array (in D3D11) requires they be the same width, height and format, so I 'group by' those values, then copy all the textures into texture arrays and create a lookup table. When it comes time to render, I now bind my texture arrays (currently about 20 of them) and draw all my geometry in a single draw call - this approach is probably a bit overboard I'll admit, but it sure is fast :)

Using dynamic indexing would allow me to index into one of the 20 bound texture arrays.

Looking into the future, it will be a great way to move a lot of scene traversal and draw submission the GPU.
Just bind a descriptor table of all textures and buffers, and there's no longer a need to split draws according to which resources they require.

This topic is closed to new replies.

Advertisement