Sign in to follow this  
IcyTower

Failed to create compute shader - Shader Model 5.1, DirectX 11.3

Recommended Posts

Hi,
when I call

ID3D11Device3::CreateComputeShader 

it fails with an error from debug layer stating:

 

"D3D11 ERROR: ID3D11Device::CreateComputeShader: Shader must be cs_4_0, cs_4_1 or cs_5_0. Shader version provided: UNRECOGNIZED [ STATE_CREATION ERROR #2097323: CREATECOMPUTESHADER_INVALIDSHADERTYPE]"

This happens when I pass shader bytecode compiled for Shader Model 5.1. It works just fine for Shader Model 5.0.

 

My setup:

Windows 10,
Windows SDK version 10.0.14393.0,
Microsoft Visual Studio 2015 Update 3,
NVIDIA GeForce GTX 1080,
GeForce Game Ready Driver 375.95, release date: 11/18/2016.

 

My project is configured to use the newest SDK. I compiled the shader using fxc.exe from within Visual Studio. But it failed also when I compiled shaders in runtime.

I create my device using D3D_FEATURE_LEVEL_11_1 as feature level and D3D11_SDK_VERSION, which equals to 7. I also succeeded at using other DirectX 11.3 feature (loading vectors from UAVs).

 

I am clueless as to what causes this error and why DirectX API doesn't recognize cs_5_1 as a correct shader model. I tried to reinstall the Windows SDK, but it didn't help. I also tried to cast my ComPtr< ID3D11Device > pointer to ComPtr< ID3D11Device3 > using ComPtr::As method, but it didn't help either.

 

Any help or suggestions would be really appreciated.

Share this post


Link to post
Share on other sites

In the first line under Shader Model 5.1 documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/dn933277%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

they write: "This section contains the reference pages for HLSL Shader Model 5.1, introduced with D3D12 and D3D11.3."

 

So I assume it is supported by D3D11. Am I wrong?

Share this post


Link to post
Share on other sites

The only shader model 5.1 feature that relate to dx11.3 is for the pixel shader using the conservative rasterisation ( plus stencil output ). The compute shader is virtually unmodified from 5.0 to 5.1 in regards to dx11.3, It is safe to assume that rejecting a 5.1 shader here is excessive, but it is not like you would have need it anyway.

Share this post


Link to post
Share on other sites

In the first line under Shader Model 5.1 documentation: https://msdn.microsoft.com/en-us/library/windows/desktop/dn933277%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

they write: "This section contains the reference pages for HLSL Shader Model 5.1, introduced with D3D12 and D3D11.3."

 

So I assume it is supported by D3D11. Am I wrong?

 

I think the documentation is wrong, Jesse Natalie (the user who replied) is working on DirectX at Microsoft..

Share this post


Link to post
Share on other sites

The only shader model 5.1 feature that relate to dx11.3 is for the pixel shader using the conservative rasterisation ( plus stencil output ). The compute shader is virtually unmodified from 5.0 to 5.1 in regards to dx11.3, It is safe to assume that rejecting a 5.1 shader here is excessive, but it is not like you would have need it anyway.

 

I believe that's just a D3D11.3 feature, that was added to SM5.0, not a SM5.1 feature. I'll get the documentation updated.

Share this post


Link to post
Share on other sites

OK, thank you very much for your answers. I was hoping to stay in D3D11 for a while, but it seems I will have to switch to D3D12.

 

But just to be 100% sure - the feature I'm looking for is indexable buffers and textures within a shader using a variable (such as loop counter). That is not available in SM5.0, right?

Share this post


Link to post
Share on other sites

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

Sign in to follow this