ID3D10Effect::Optimize method (d3d10effect.h)

Minimize the amount of memory required for an effect.

Syntax

HRESULT Optimize();

Return value

Type: HRESULT

Returns one of the following Direct3D 10 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 ID3D10Effect::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 that references retrieved with these methods before calling ID3D10Effect::Optimize are still valid after ID3D10Effect::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.

Requirements

Requirement Value
Target Platform Windows
Header d3d10effect.h

See also

ID3D10Effect Interface