Hi all,
I’m trying to set a constant buffer which contains an array of floats (the buffer is intended for holding weights of filter).
In the hlsl file I defined the constant buffer as follows:
cbuffer FilterParameters
{
float g_aFilterWeight[7];
};
When doing this, the array will never hold the values I inserted in the C++. why ?
In order to check it, I changed it as follows:
cbuffer FilterParameters
{
float g_aFilterWeight0;
float g_aFilterWeight1;
float g_aFilterWeight2;
float g_aFilterWeight3;
float g_aFilterWeight4;
float g_aFilterWeight5;
float g_aFilterWeight6;
};
In this case, the variables holds exactly the values I set through the c++ program, and everithing is ok.
Why the “array” form doesn’t work??