0

When I'm reading the asm code ,I dont know how to get the instruction "ld" just below. Which function should I use in HLSL to get it? Or had it be replaced with the update of versions? The following is asm code:

ld r0.xyzw r0.xyzw t19.xyzw

I tried to use texture2D in HLSL but when compiled it was "sample " not "ld".

1 Answers1

1

ld is a Shader Model 4.0 or later instruction. Which shader profile & HLSL compiler are you using?

The Load member of a texture object is typically how you do this in modern HLSL.

Texture2D<float4> g_Input : register( t0 ); 


float4 pixel = g_Input.Load(...);
Chuck Walbourn
  • 38,259
  • 2
  • 58
  • 81