mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Make sure shader info search paths are always available. Refs #572
* Previously they were only set when replaying a recorded SetPrivateData which meant any blob paths specified in the private blob part didn't have the search paths configured for locating relative paths.
This commit is contained in:
@@ -3445,7 +3445,7 @@ bool WrappedID3D11Device::Serialise_SetShaderDebugPath(ID3D11DeviceChild *res, c
|
||||
auto it = WrappedShader::m_ShaderList.find(GetResourceManager()->GetLiveID(resource));
|
||||
|
||||
if(it != WrappedShader::m_ShaderList.end())
|
||||
it->second->SetDebugInfoPath(&m_ShaderSearchPaths, debugPath);
|
||||
it->second->SetDebugInfoPath(debugPath);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -450,6 +450,7 @@ public:
|
||||
return m_LayoutDescs[layout];
|
||||
}
|
||||
|
||||
vector<string> *GetShaderDebugInfoSearchPaths() { return &m_ShaderSearchPaths; }
|
||||
void Serialise_CaptureScope(uint64_t offset);
|
||||
|
||||
void StartFrameCapture(void *dev, void *wnd);
|
||||
|
||||
@@ -1100,7 +1100,8 @@ bool WrappedID3D11Device::Serialise_CreateInputLayout(
|
||||
|
||||
m_LayoutDescs[ret] = descvec;
|
||||
if(BytecodeLen > 0 && ShaderBytecode)
|
||||
m_LayoutShaders[ret] = new WrappedShader(GetIDForResource(ret), ShaderBytecode, BytecodeLen);
|
||||
m_LayoutShaders[ret] =
|
||||
new WrappedShader(this, GetIDForResource(ret), ShaderBytecode, BytecodeLen);
|
||||
|
||||
SAFE_DELETE_ARRAY(ShaderBytecode);
|
||||
}
|
||||
|
||||
@@ -896,10 +896,10 @@ public:
|
||||
{
|
||||
public:
|
||||
ShaderEntry() : m_DebugInfoSearchPaths(NULL), m_DXBCFile(NULL), m_Details(NULL) {}
|
||||
ShaderEntry(const byte *code, size_t codeLen)
|
||||
ShaderEntry(WrappedID3D11Device *device, const byte *code, size_t codeLen)
|
||||
{
|
||||
m_Bytecode.assign(code, code + codeLen);
|
||||
m_DebugInfoSearchPaths = NULL;
|
||||
m_DebugInfoSearchPaths = device->GetShaderDebugInfoSearchPaths();
|
||||
m_DXBCFile = NULL;
|
||||
m_Details = NULL;
|
||||
}
|
||||
@@ -910,12 +910,7 @@ public:
|
||||
SAFE_DELETE(m_Details);
|
||||
}
|
||||
|
||||
void SetDebugInfoPath(vector<std::string> *searchPaths, const std::string &path)
|
||||
{
|
||||
m_DebugInfoSearchPaths = searchPaths;
|
||||
m_DebugInfoPath = path;
|
||||
}
|
||||
|
||||
void SetDebugInfoPath(const std::string &path) { m_DebugInfoPath = path; }
|
||||
DXBC::DXBCFile *GetDXBC()
|
||||
{
|
||||
if(m_DXBCFile == NULL && !m_Bytecode.empty())
|
||||
@@ -949,12 +944,13 @@ public:
|
||||
static map<ResourceId, ShaderEntry *> m_ShaderList;
|
||||
static Threading::CriticalSection m_ShaderListLock;
|
||||
|
||||
WrappedShader(ResourceId id, const byte *code, size_t codeLen) : m_ID(id)
|
||||
WrappedShader(WrappedID3D11Device *device, ResourceId id, const byte *code, size_t codeLen)
|
||||
: m_ID(id)
|
||||
{
|
||||
SCOPED_LOCK(m_ShaderListLock);
|
||||
|
||||
RDCASSERT(m_ShaderList.find(m_ID) == m_ShaderList.end());
|
||||
m_ShaderList[m_ID] = new ShaderEntry(code, codeLen);
|
||||
m_ShaderList[m_ID] = new ShaderEntry(device, code, codeLen);
|
||||
}
|
||||
virtual ~WrappedShader()
|
||||
{
|
||||
@@ -995,7 +991,7 @@ public:
|
||||
WrappedID3D11Shader(RealShaderType *real, const byte *code, size_t codeLen,
|
||||
WrappedID3D11Device *device)
|
||||
: WrappedDeviceChild11<RealShaderType>(real, device),
|
||||
WrappedShader(GetResourceID(), code, codeLen)
|
||||
WrappedShader(device, GetResourceID(), code, codeLen)
|
||||
{
|
||||
}
|
||||
virtual ~WrappedID3D11Shader() { Shutdown(); }
|
||||
|
||||
Reference in New Issue
Block a user