This code is good when building the .fx file in MGPT 3.7.0.944:
struct directional_light {
float3 vDiffuseColor;
float fIntensity;
float3 vDirection;
bool bLid;
};
static const int MAX_DIR_LIGHTS = 12;
But adding this line results in “Unsupported parameter class!”:
directional_light dlDirLights[MAX_DIR_LIGHTS];
I’ve added comments to this issue.
Repeating those comments here, to make sure the issue is more widely discussed:
In 3.7.0.994, structs build, but an array of structs still gives “Unsupported parameter class!”.
Is this expected? Planned for final 3.7?
I see “Unsupported parameter class!” in ConstantBufferData.sharpdx.cs (I’m using MG on WIndows+DX) / GetParameterFromType().
Is the fix as simple as adding a case?
case SharpDX.D3DCompiler.ShaderVariableClass.Struct:
param.class_ = EffectObject.D3DXPARAMETER_CLASS.STRUCT;
break;
(I’m not set up to build MG, so I can’t easily test this.)