Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some bugs #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions BinaryDecompiler/include/hlslcc.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef HLSLCC_H_
#define HLSLCC_H_

#include <string>
#include <vector>
#include <map>

Expand Down
1 change: 1 addition & 0 deletions D3D_Shaders/Assembler.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "stdafx.h"
#include <stdexcept>

using namespace std;

Expand Down
6 changes: 5 additions & 1 deletion HLSLDecompiler/DecompileHLSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down