ID3DX11Effect::Optimize method

Minimize the amount of memory required for an effect.

Syntax

HRESULT Optimize();

Parameters

This method has no parameters.

Return value

Type: HRESULT

Returns one of the following Direct3D 11 Return Codes.

Remarks

An effect uses memory space two different ways: to store the information required by the runtime to execute an effect, and to store the metadata required to reflect information back to an application using the API. You can minimize the amount of memory required by an effect by calling ID3DX11Effect::Optimize which removes the reflection metadata from memory. API methods to read variables will no longer work once reflection data has been removed.

The following methods will fail after Optimize has been called on an effect.

Note

References retrieved with these methods before calling ID3DX11Effect::Optimize are still valid after ID3DX11Effect::Optimize is called. This allows the application to get all the variables, techniques, and passes it will use, call Optimize, and then use the effect.

Note

The DirectX SDK does not supply any compiled binaries for effects. You must use Effects 11 source to build your effects-type application. For more information about using Effects 11 source, see Differences Between Effects 10 and Effects 11.

Requirements

Requirement Value
Header
D3dx11effect.h
Library
N/A (An Effects 11 library is available online as shared source.)

See also

ID3DX11Effect