Jump to content
  • Advertisement
Sign in to follow this  
yoelshoshan

HLSL Assembly

This topic is 3415 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, Is there anywhere a definition of the hlsl assembly BINARY structure? I need to read a hlsl binary and understand the opcodes that i'm reading. (I'm aware it's quite reverse of common usage) Appereciate any help :) Cheers!

Share this post


Link to post
Share on other sites
Advertisement
I don't believe the binary format is documented anywhere.

However you should be able to load up the shader in an app, and then use PIX to view the assembly.

EDIT: I was totally wrong, ignore me. [smile]

[Edited by - MJP on May 17, 2009 1:21:53 PM]

Share this post


Link to post
Share on other sites
MJP:
Thanks but i was aiming to do it in real time anyway (my app needs to really understand the binary on the fly - not manually using pix) :)

J-Fox:
Wow! Thanks a lot for that great link, i searched quite a lot and didn't find it - you just saved me a whole lot of work! =]



Share this post


Link to post
Share on other sites
Great Failure...

It seems that the documentation is only relevant to SM1,2,3
and NOT to SM4 :/


[Edited by - yoelshoshan on May 19, 2009 8:17:38 AM]

Share this post


Link to post
Share on other sites
Thats highly possible.
You could check if the headers define other constants which sound like tokens for shaders and try to look them up on the msdn or just contact ms directly.

Share this post


Link to post
Share on other sites
Hey guys,

I was wondering what you're interested in doing since for sm 4.0+ we do not make the assembler available publicly. In addition, the header blob(s) format is also not published since it could change at any time.

Dieter

Share this post


Link to post
Share on other sites
DieterVW:

Mostly educational purposes:
1. Looking in games Shaders, and learning a thing or two =]
2. Changing a game behaviour from outside

Reversing it is of course an option, But i prefer to see if there's available info on this anywhere before i start.

Share this post


Link to post
Share on other sites
Quote:
Original post by DieterVW
Hey guys,

I was wondering what you're interested in doing since for sm 4.0+ we do not make the assembler available publicly. In addition, the header blob(s) format is also not published since it could change at any time.

Dieter

Actually, moreover, if I recall correctly, Direct3D 10 doesn't allow assembly for shaders at all =/ Though I guess that makes sense because it allows GPUs to use whatever internal language the manufacturer wants.

EDIT: um, that sounds like I tried to mean that the GPUs use the same assembly as Direct3D pre-10 did =P My point was that not all assembly instructions may be easily translatable (at least in the future), or that it may end up missing on a lot of instructions the manufacturer may want to add (something the compiler wouldn't miss because that would be part of the device-specific driver), etc.

Share this post


Link to post
Share on other sites
I didn't mention the exact info i'm trying to extract from the binary.
What i'm looking for is the Resource Binding information,

"... with an assembly language-like instruction set, input and output registers for inter-stage communication, general purpose registers ..., and a set of RESOURCE BINDING points for attaching memory resources such as texture images."

(i can extract the input and output registers from the DDI layer)

Quoting from here:

Direct3d10_web.pdf

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!