• Advertisement
Sign in to follow this  

HLSL -> Assembly instructions not documented

This topic is 2162 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I have been debugging an assembly shader code which was originaly written in HLSL, however watching at the code generated it looks like there are some kind of instructions which are not documented in microsoft's site ( http://msdn.microsof...2(v=vs.85).aspx ).

specifically, within all the assembly code I have found this "instruction":

sample_indexable(texture2d)(float,float,float,float) r0.y, v1.xyxx, t3.yxzw, s4

however, I can't find what exactly does that do, I mean, what kind of operations do it happen with v1.xyxx, t3.yxzw, s4 and get stored (i guess) in r0.y.

does anyone have any idea what it is doing, or where can I find information about it?

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
You want the documentation for the sample instruction.

v1 contains the texture coordinate to use for sampling, t3 is the resource binding register (AKA the register to which your Texture2D is bound), and s4 is the sampler binding register (AKA the register to which your SamplerState is bound). r0 is where the result is stored.

Share this post


Link to post
Share on other sites
Thanks MJP!

I see, I was looking for the whole "sample_indexable(x)(float,float,float,float)" instruction.. so that's why I didn't found anything...

so basically:

[color=#000000]sample_indexable(texture2d)(float,float,float,float) r0.y, v1.xyxx, t3.yxzw, s4

[color=#000000]Is the same as doing:

sample r0.y, v1.xyxx, t3.yxzw, s4

right?.. or does the "_indexable(texture2D)(float,float,float,float)" appended to the instruction gives any extra functionality?


But thanks again!... you basically answered what I was looking for =)

now I understand that it was the same instruction as "sample" alone and not a new one...

Share this post


Link to post
Share on other sites
Yeah the _indexable part is a modifier. I'm not sure what the exact meaning of it is, since I've never seen it anywhere in the documentation. However the compiler seems to always use it for ps_5_0 shaders.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement