diff --git a/BinaryDecompiler/include/hlslcc.h b/BinaryDecompiler/include/hlslcc.h index 836b6f9..e14c29f 100644 --- a/BinaryDecompiler/include/hlslcc.h +++ b/BinaryDecompiler/include/hlslcc.h @@ -1,6 +1,7 @@ #ifndef HLSLCC_H_ #define HLSLCC_H_ +#include #include #include diff --git a/D3D_Shaders/Assembler.cpp b/D3D_Shaders/Assembler.cpp index c7a9abd..29c5a99 100644 --- a/D3D_Shaders/Assembler.cpp +++ b/D3D_Shaders/Assembler.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include using namespace std; diff --git a/HLSLDecompiler/DecompileHLSL.cpp b/HLSLDecompiler/DecompileHLSL.cpp index 71052fa..3ef2835 100644 --- a/HLSLDecompiler/DecompileHLSL.cpp +++ b/HLSLDecompiler/DecompileHLSL.cpp @@ -3042,6 +3042,9 @@ class Decompiler else if (!strcmp(statement, "dcl_constantbuffer")) { char *strPos = strstr(op1, "cb"); + if (!strPos) // sometimes the disassembler puts uppercase + strPos = strstr(op1, "CB"); + if (strPos) { int bufIndex = 0; @@ -3068,7 +3071,8 @@ class Decompiler // and create the fake cb2 style names as the best we can do. // Not sure this will work in all cases, because the offsets into the buffer are // not required to be zero for the first element, but we have no other info here. - if (mCBufferNames.empty()) + // There will still always be a single cbuffer in here, since it is made in ParseBufferDefinitions. + if (mCBufferNames.size() <= 1) { BufferEntry e; e.bt = DT_float4;