HLSL Assembly

Started by
9 comments, last by DieterVW 14 years, 11 months ago
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!
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]
http://msdn.microsoft.com/en-us/library/ms800355.aspx

This was linked from the wine FAQ and I had a quick look at it some weeks ago - I guess this is what you are looking for
PS: I wish there was something like that for OpenGL ES 2.0 :(
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! =]



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]
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.
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
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.
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.
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.
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

This topic is closed to new replies.

Advertisement