Added two methods in DXDecompiler.DX9Shader.Bytecode.Declaration's ConstantDeclaration
(GetRegisterTypeByOffset() and GetMemberNameByOffset())
which allow us to get register information and member variable name from a DX9 constant declaration, by using an offset.
It can be used figure out the member variable type,
or the register full length (DXDecompiler.DX9Shader's RegisterState.GetRegisterFullLength()),
or the member variable name (RegisterState.GetRegisterName()).
PS: I've added a tab size = 4 in .editorconfig, because it's used by Github too, so Github can correctly display tabs with width of 4 spaces.
I'm not sure if that's your preference, if you prefer something like 8 or 2 as tab size, just tell me (or you can just change it yourself 😄)
Added two methods in
DXDecompiler.DX9Shader.Bytecode.Declaration
'sConstantDeclaration
(GetRegisterTypeByOffset()
andGetMemberNameByOffset()
) which allow us to get register information and member variable name from a DX9 constant declaration, by using an offset.It can be used figure out the member variable type, or the register full length (
DXDecompiler.DX9Shader
'sRegisterState.GetRegisterFullLength()
), or the member variable name (RegisterState.GetRegisterName()
).DXDecompiler.Tests/TestFixtures/TestDX9Effects.cs contains some sample code on how they can be used.
Example (took from test case): it's now able to figure out that the constant register
c19
is actuallyu[2].t[1].v
PS: I've added a tab size = 4 in
.editorconfig
, because it's used by Github too, so Github can correctly display tabs with width of 4 spaces. I'm not sure if that's your preference, if you prefer something like 8 or 2 as tab size, just tell me (or you can just change it yourself 😄)