-1

error X3523: DX9-style intrinsics are disabled when not in dx9 compatibility mode

how to use the tex2Dgrad() function in dx10?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Nico
  • 11
  • 3

1 Answers1

1

You could turn on the back-compat mode (i.e. use /Gec switch with the FXC.EXE command-line or the D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY flag with the D3DCompile APIs).

Alternatively, instead of using the DirectX 9 style tex2Dgrad() intrinsic, use the 'Texture object' syntax that was introduced with Direct3D 10 / Shader Model 4:

Texture2D <float4> MyTex : t0;
Sampler MySampler : s0;

float4 value = MyTex.SampleGrad(MySampler, TexCoord, dx, dy);

See MSDN

Note that there is no reason to use the Direct3D 10.x API at all. You should be using Direct3D 11 which supports a broader range of hardware, has clearer thread-safety syntax, supports additional features, and has a much better supported set of utility libraries. Direct3D 11 is available on all supported platforms that included Direct3D 10. See this ppt from Gamefest 2010 for a detailed walkthrough of the differences.

Chuck Walbourn
  • 38,259
  • 2
  • 58
  • 81