2
\$\begingroup\$

Under Windows 8, what is the alternative to this code:

technique11 Light0Tex
{
    pass P0
    {
        ...

technique11 Light1Tex
{
    pass P0
    {
        ...

And:

Light1Tech    = mFX->GetTechniqueByName("Light1");

...

Light1Tech->GetPassByIndex(p)->Apply(0, md3dImmediateContext);
\$\endgroup\$
2
  • \$\begingroup\$ SharpDX.Toolkit has some custom functionality that wraps it. \$\endgroup\$
    – r2d2rigo
    Dec 21, 2012 at 13:30
  • \$\begingroup\$ In case it wasn't clear from Chuck's answer, this syntax belongs to the old-and-somewhat-deprecated "effect" system, which allowed wrapping up multiple shaders and render states in one source file using the technique/pass structure, and also provided a runtime API wrapping constant buffers and state-setting. D3D has moved away from this model; it now only officially supports one shader per file, and you must set up all constant buffers and state objects yourself. \$\endgroup\$ Jul 4, 2014 at 3:10

1 Answer 1

1
\$\begingroup\$

Effects 11 is not supported by Windows Store apps for Windows 8.0 because it requires D3DCompile APIs at runtime. Hence, 'technique11' and it's kin are deprecated.

Effects 11 also has specific compiler support in the HLSL compiler, which in the latest (#47) is still there but emits a warning. Some newer DX 11.1 and DX 11.2 constructs are not supported with the legacy fx_5_0 profile.

All that said, you can technically use Effects 11 in a Windows Store app for Windows 8.1 because D3DCompiler #47 is present at runtime. You can also continue to use Effects 11 for Win32 desktop apps as long as you recognize a future HLSL compiler revision is likely to remove support for the required fx_5_0 profile.

See the Effects 11 CodePlex project.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .