Shader disassembly + (?) = bytecode + constant table

Started by
1 comment, last by JamieT187 9 years ago

I'd like to assemble a shader from a disassembly string, that'll also include a constant table in bytecode output.

I'm looking for a clean way to be able to modify the default values in the constant table.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb172707%28v=vs.85%29.aspx

This says... "ppShader [out] - Returns a buffer containing the created shader. This buffer contains the compiled shader code, as well as any embedded debug and symbol table information." ... Symbol Table is what I'm after, right? I've no idea how I'd generate that. This constant/symbol table info is commented out in the disassembly string.

Do I need to define something in the "Macro" or "IncludeFiles"? I've no idea how to use those parameters. Any tips?

Advertisement

The constant table is reconstructed by D3DX by extracting the CTAB section in the bytecode data. It is just a comment section.

http://www.gamedev.net/topic/648016-replacement-for-id3dxconstanttable/

Form the looks of it, sebi707 provided some code from Wine on reading the data from this section. Then you can write data as well.

The way I did it was to strip that comment section and append one in my own format describing the constants.

Edit: unfortunately his does not seem to handle the default values, but wines does seems to check it.

Thanks yuri,

I hadn't considered writing my own comment section to describe the constants. Maybe that will be the best way to go.

I'm still unclear about how I would use the Include & Macro parameters, so if anyone has any tips for me on that, I'd like to know how they're used even if they're not relevant to what I'm doing.

Cheers

This topic is closed to new replies.

Advertisement