Very simple question...
I have some example of code:
technique Draw
{
pass
{
vertex_shader = VertexShaerName(vec_in);
pixel_shader = PixelShaderName(vec_in);
}
}
Where can I find documentation of technique
keyword usage? Here is no link with description provided for such a statetament...
Techniques are used by the (now deprecated) effects system.
It wraps a lot of the low level api (originally DirectX9 worked with techniques, so this was created to facilitate transition between direct3d9 to direct3d10/11).
It provides helpers to manage constant buffers and a reflection/variable api to assign data to the shaders.
So while with low level pipeline you would compile your vertex and pixel shaders independently, create you constant buffers, and the structures that go with it it allows to build everything in a single block, breaks down constant buffers into a variable system and has a pass api that allows to perform binding all in one go.
Both have their pros and cons, fx is really nice for authoring and prototyping (its really easy to use their variable system to create automatic gui for example), but since it manages a lot of boilerplate for you, but it gets a bit awkard when it comes to efficient resource reuse or complex shader permutations.
One thing which I particularly miss from effects are variable semantics and annotations, you could set things like :
float2 tex : TARGETSIZE;
and by using variable system detect that tex has a TARGETSIZE semantic, hide from ui and auto attach render taget size for example.
Old common usage for annotations were to provide some metatada to values like :
float4 color <bool color=true;> = 1.0f;
Reflecting across annotations allows to see we consider this variable as a color (and display a color picker in editor instead of 4 channels)
While the fx_5_0 profile is deprecated in the d3dcompiler_47, it is still possible to use it, and the wrapper is open source: https://github.com/microsoft/FX11