Sign in to follow this  
JB2009

DirectCompute: How to get the thread group size of an Effects11 compute shader?

Recommended Posts

JB2009    100
Is there a way to get the thread group size (i.e. from the "numthreads" hlsl attribute) of an Effects11 compute shader?

The ID3D11ShaderReflection->GetThreadGroupSize(...) method gives this information, but I can't find a way to get the ID3D11ShaderReflection interface for Effects11 compute shaders (even though Effects11 uses D3DReflect internally).

JB.

[Edited by - JB2009 on October 11, 2010 9:56:24 AM]

Share this post


Link to post
Share on other sites
DieterVW    724
The function ID3DX11EffectPass::GetComputeShaderDesc() fills in a D3DX11_PASS_SHADER_DESC structure. This structure contains a shader index D3DX11_PASS_SHADER_DESC::ShaderIndex and a ID3DX11EffectShaderVariable. Use these variables to get the shader description that contains the shader byte code with ID3DX11EffectShaderVariable::GetShaderDesc(). From there you can use normal reflection on the byte code to proceed as usual.

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