D3DXFX

Options for saving and creating effects.

The constants in the following table are defined in d3dx9effect.h.

Effect State Save and Restore Flags Description
D3DXFX_DONOTSAVESTATE No state is saved when calling Begin or restored when calling End.
D3DXFX_DONOTSAVESAMPLERSTATE A stateblock saves state when calling Begin and restores state when calling End.
D3DXFX_DONOTSAVESHADERSTATE A stateblock saves state (except shaders and shader constants) when calling Begin and restores state when calling End.
Effect Creation Flags Description
D3DXFX_NOT_CLONEABLE The effect will be non-cloneable and will not contain any shader binary data. GetPassDesc will not return shader function pointers. Setting this flag reduces effect memory usage by about 50% because it eliminates the need for the effect system to keep a copy of the shaders in memory. This flag is used by D3DXCreateEffect, D3DXCreateEffectFromFile, and D3DXCreateEffectFromResource.
D3DXFX_LARGEADDRESSAWARE Enables the allocation of an effect resource into the uppder address space of a machine. One important limitation is that you cannot use strings and handles interchangeably. For example, the following would no longer work.
g_pEffect->SetMatrix( "g_mWorldViewProjection", &mWorldViewProjection );

Instead, a method such as GetParameterByName must be used to store the handle of the parameter, which is then used to pass variables to the effect.

 

The constants in the following table are not defined by default and must be defined by the developer.

Effect Preprocessor #define's Description
D3DXFX_LARGEADDRESS_HANDLE Define this value before including d3dx9.h so that your application fails to compile when attempting to pass strings into D3DXHANDLE parameters. This will aid in making sure that valid information is being passed to the runtime.
Effect Linker Flags Description
LARGE_ADDRESS_AWARE Setting the linker flag LARGE_ADDRESS_AWARE = 1 will allow the application to allocate resources past the 2GB address limit when needed.

 

The effect system uses state blocks to save and restore state automatically. For more information about state blocks, see State Blocks Save and Restore State (Direct3D 9).

Effect Constants