Compiled shader file format DirectX9?

Is the format of the compiled object files of the pixel and vertex shaders created by fxc.exe documented somewhere officially or unofficially?

I would like to be able to read the name of the constant for registering assignments from shader files. I know that the effects structure in D3DX can do this, but I need to avoid using D3DX, since it cannot be installed on user machines, and I don't need it for anything else, so I want them not to run the directx update.

If the effects structure can do this, then I can, if I can find out the file format, but I can "find it somewhere in the documents."

(this is used in directx9)

+3
source share
3 answers

Microsoft intentionally withholds this information from you. Since you are using DirectX 9, it is relatively easy to reverse engineer the format. If you write a simple piece of the shader assembly, you can verify that it compiled the code returned from the other side. By making changes to the assembler, you can see how they change. You will begin to see patterns in how registers are handled and where the command is encoded. Thus, you can slowly but surely develop the byte code. It won't be too fast though!

0
source

From MSDN:

Asm Shader Help (Windows)

Binary shader format

D3d9types.h. , , Direct3D 9 Driver Development Kit (DDK).

, "D3d9type.h", ( /, , ), DDK .


: Direct3D Shader Codes ( , ).

+8

Microsoft : Direct3D Shader Codes.

However, it refers to constants by name (for example, D3DSIO_DCL), so you will most likely need the Windows DDK to take advantage of this.

0
source

Source: https://habr.com/ru/post/1739149/


All Articles