I want to create a custom Direct2D effect and I was looking into the following example...
http://code.msdn.microsoft.com/windowsapps/Direct2D-custom-image-7a1f2cb5
I see the following lines for passing parameters to the shader...
Texture2D InputTexture : register(t0);
SamplerState InputSampler : register(s0);
cbuffer constants : register(b0)
{
float frequency : packoffset(c0.x);
float phase : packoffset(c0.y);
float amplitude : packoffset(c0.z);
float spread : packoffset(c0.w);
float2 center : packoffset(c1);
};
I do not understand the packoffset and how to use the registers (c0, c1 etc.) and I could not find any reference as well on the internet.
My requirement is such that I need to pass 4 byte arrays each of size 256. How do I do that, if at all possible? Something like...
Texture2D InputTexture : register(t0);
SamplerState InputSampler : register(s0);
cbuffer constants : register(b0)
{
byte set1[256] : packoffset(c0);
byte set2[256] : packoffset(c?);
byte set3[256] : packoffset(c?);
byte set4[256] : packoffset(c?);
};
Which registers shall I use?