HLSL -> Assembly instructions not documented

Started by
2 comments, last by MJP 12 years ago
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!
"lots of shoulddas, coulddas, woulddas in the air, thinking about things they shouldda couldda wouldda donne, however all those shoulddas coulddas woulddas ran away when they saw the little did to come"
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.
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...
"lots of shoulddas, coulddas, woulddas in the air, thinking about things they shouldda couldda wouldda donne, however all those shoulddas coulddas woulddas ran away when they saw the little did to come"
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.

This topic is closed to new replies.

Advertisement