Jump to content
  • Advertisement
Sign in to follow this  
16bit_port

DX11 Shader model 5 issue

This topic is 2849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I currently have everything running fine with D3D11 and shader model 4.0, but once I changed the shader profile to "vs_5_0" (only thing that I changed) ID3D11Device::CreateVertexShader() returns invalid argument.

D3DX11CompileFromFile() returns S_OK.

so what's the deal here? My card only supports DirectX 10 if that matters at all.

Share this post


Link to post
Share on other sites
Advertisement
Yes, shader model 5 will only run on dx11 hardware. Your API is create a dx10 device which you are using through the DX11 API. This setup is called using feature levels. When you create the DX11 device it provides you a return value indicating which feature level the device is. Your shaders will have to be compiled to a target compatible with that featurelevel.

Feature level 10 -> shader model 4.0
Feature level 10.1 -> shader model 4.1
Feature level 11 -> shader model 5.0

Share this post


Link to post
Share on other sites
Quote:

This setup is called using feature levels. When you create the DX11 device it provides you a return value indicating which feature level the device is.


I use D3D11CreateDeviceAndSwapChain. I don't see anything at MSDN, that tells me that.

Also, I'm kind of confused. Are you saying that I need dx11 hardware to run shader model 5 or are you saying that I can just use feature levels to get it to work? Because I can run the ContactHardeningShadows11 sample executable (it gets past the "compiling shaders" message) albeit 99% of the time the screen is black and 1% of the time I can actually see the brick pillars.

My card is a GeForce 8800 GTS 512.

Share this post


Link to post
Share on other sites
Take a quick read here. This reference discusses how D3D11 can run on dx9 and up hardware. When the devices is created you can view the pFeatureLevel parameter from D3D11CreateDeviceAndSwapChain() or ID3D11Device->GetFeatureLevel() API. For your 8800GT the maximum feature level the device could successfully be created on will be feature level 10. That means you'll be restricted to just DX10 features plus a few extras like multithreading if you have a recent driver. You will be restricted to only sm 4.0 shaders since that is all your hardware is capable of and that's tied to the feature level.

This should make more sense after reading over that page.

Share this post


Link to post
Share on other sites
Quote:
Original post by 16bit_port
I use D3D11CreateDeviceAndSwapChain. I don't see anything at MSDN, that tells me that.


Take a closer look. Specifically at the "pFeatureLevels" and "pFeatureLevel" parameters.

Quote:
Original post by 16bit_port
Also, I'm kind of confused. Are you saying that I need dx11 hardware to run shader model 5 or are you saying that I can just use feature levels to get it to work?


Feature levels just let you create and use a D3D11 device but with a subset of available features. Your 8800 will only let you create up to FEATURE_LEVEL_10_0, which means shader model 4.0 max. See this chart for a list of features per feature level.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!