Fix uninitialized variable warnings from static analysis

* Reported by Coverity Scan
This commit is contained in:
baldurk
2017-11-22 11:31:07 +00:00
parent 05d7ae9fec
commit c860d8baa3
43 changed files with 190 additions and 138 deletions
-2
View File
@@ -59,8 +59,6 @@ CaptureContext::CaptureContext(QString paramFilename, QString remoteHost, uint32
m_CaptureLoaded = false;
m_LoadInProgress = false;
m_EventID = 0;
memset(&m_APIProps, 0, sizeof(m_APIProps));
m_CurD3D11PipelineState = &m_DummyD3D11;
+7 -7
View File
@@ -272,8 +272,8 @@ private:
void LoadCaptureThreaded(const QString &captureFile, const QString &origFilename, bool temporary,
bool local);
uint32_t m_SelectedEventID;
uint32_t m_EventID;
uint32_t m_SelectedEventID = 0;
uint32_t m_EventID = 0;
const DrawcallDescription *GetDrawcall(const rdcarray<DrawcallDescription> &draws, uint32_t eventID)
{
@@ -315,19 +315,19 @@ private:
QMap<ResourceId, QString> m_CustomNames;
int m_CustomNameCachedID = 1;
const SDFile *m_StructuredFile;
const SDFile *m_StructuredFile = NULL;
SDFile m_DummySDFile;
rdcarray<WindowingSystem> m_WinSystems;
WindowingSystem m_CurWinSystem;
WindowingSystem m_CurWinSystem = WindowingSystem::Unknown;
#if defined(RENDERDOC_PLATFORM_LINUX)
xcb_connection_t *m_XCBConnection;
Display *m_X11Display;
xcb_connection_t *m_XCBConnection = NULL;
Display *m_X11Display = NULL;
#endif
QIcon *m_Icon;
QIcon *m_Icon = NULL;
// Windows
MainWindow *m_MainWindow = NULL;
+10 -10
View File
@@ -44,14 +44,14 @@ void ReplayManager::OpenCapture(const QString &capturefile, float *progress)
if(m_Running)
return;
m_ProxyRenderer = -1;
m_ReplayHost = QString();
m_CaptureFilename = capturefile;
m_Progress = progress;
// TODO maybe we could expose this choice to the user?
int proxyRenderer = -1;
*progress = 0.0f;
m_Thread = new LambdaThread([this]() { run(); });
m_Thread = new LambdaThread([this, proxyRenderer, capturefile, progress]() {
run(proxyRenderer, capturefile, progress);
});
m_Thread->start(QThread::HighestPriority);
while(m_Thread->isRunning() && !m_Running)
@@ -403,29 +403,29 @@ void ReplayManager::PushInvoke(ReplayManager::InvokeHandle *cmd)
m_RenderCondition.wakeAll();
}
void ReplayManager::run()
void ReplayManager::run(int proxyRenderer, const QString &capturefile, float *progress)
{
m_Renderer = NULL;
if(m_Remote)
{
std::tie(m_CreateStatus, m_Renderer) =
m_Remote->OpenCapture(~0U, m_CaptureFilename.toUtf8().data(), m_Progress);
m_Remote->OpenCapture(proxyRenderer, capturefile.toUtf8().data(), progress);
}
else
{
m_CaptureFile = RENDERDOC_OpenCaptureFile();
m_CreateStatus = m_CaptureFile->OpenFile(m_CaptureFilename.toUtf8().data(), "rdc");
m_CreateStatus = m_CaptureFile->OpenFile(capturefile.toUtf8().data(), "rdc");
if(m_CreateStatus == ReplayStatus::Succeeded)
std::tie(m_CreateStatus, m_Renderer) = m_CaptureFile->OpenCapture(m_Progress);
std::tie(m_CreateStatus, m_Renderer) = m_CaptureFile->OpenCapture(progress);
}
if(m_Renderer == NULL)
return;
qInfo() << "QRenderDoc - renderer created for" << m_CaptureFilename;
qInfo() << "QRenderDoc - renderer created for" << capturefile;
m_Running = true;
+2 -7
View File
@@ -115,7 +115,7 @@ private:
bool selfdelete;
};
void run();
void run(int proxyRenderer, const QString &capturefile, float *progress);
QMutex m_RenderLock;
QQueue<InvokeHandle *> m_RenderQueue;
@@ -126,16 +126,11 @@ private:
void PushInvoke(InvokeHandle *cmd);
int m_ProxyRenderer;
QString m_ReplayHost;
QString m_CaptureFilename;
float *m_Progress;
QMutex m_RemoteLock;
RemoteHost *m_RemoteHost = NULL;
IRemoteServer *m_Remote = NULL;
volatile bool m_Running;
LambdaThread *m_Thread;
ReplayStatus m_CreateStatus;
ReplayStatus m_CreateStatus = ReplayStatus::Succeeded;
};
+1 -1
View File
@@ -132,7 +132,7 @@ private:
static PyObject *QtObjectToPython(const char *typeName, QObject *object);
QTimer *outputTicker;
QTimer *outputTicker = NULL;
QMutex outputMutex;
QString outstr, errstr;
+2 -2
View File
@@ -91,7 +91,7 @@ protected:
QPair<ResizeType, int> checkResizing(QMouseEvent *event);
QPair<ResizeType, int> m_resizeState;
int m_cursorPos;
int m_cursorPos = -1;
void cacheSections();
void resizeSectionsWithHints();
@@ -121,7 +121,7 @@ protected:
int m_pinnedColumns = 0;
int m_movingSection = -1;
QLabel *m_sectionPreview;
QLabel *m_sectionPreview = NULL;
int m_sectionPreviewOffset = 0;
};
+1 -1
View File
@@ -49,5 +49,5 @@ protected:
bool event(QEvent *e);
private:
bool m_acceptTabs;
bool m_acceptTabs = false;
};
+1 -1
View File
@@ -78,7 +78,7 @@ private:
None,
White,
Black,
} m_DragMode;
} m_DragMode = DraggingMode::None;
QVector<uint32_t> m_HistogramData;
float m_HistogramMin = 0.0f;
@@ -65,7 +65,11 @@ struct SortValue
else
val.u = result.value.u32;
default: break;
default:
qCritical() << "Unexpected component type" << ToQStr(description.resultType);
type = Float;
val.d = -1.0;
break;
}
}
};
@@ -59,7 +59,7 @@ struct D3D11ViewTag
OMDepth,
};
D3D11ViewTag() {}
D3D11ViewTag() : type(SRV), index(0) {}
D3D11ViewTag(ResType t, int i, const D3D11Pipe::View &r) : type(t), index(i), res(r) {}
ResType type;
int index;
@@ -1828,7 +1828,7 @@ void D3D11PipelineStateViewer::resource_itemActivated(RDTreeWidgetItem *item, in
}
else if(buf)
{
D3D11ViewTag view = {};
D3D11ViewTag view;
if(tag.canConvert<D3D11ViewTag>())
view = tag.value<D3D11ViewTag>();
@@ -83,7 +83,7 @@ struct D3D12ViewTag
OMDepth,
};
D3D12ViewTag() {}
D3D12ViewTag() : type(SRV), space(0), reg(0) {}
D3D12ViewTag(ResType t, int s, int r, const D3D12Pipe::View &rs)
: type(t), space(s), reg(r), res(rs)
{
+3
View File
@@ -96,8 +96,11 @@ struct TexSettings
{
TexSettings()
{
displayType = 0;
r = g = b = true;
a = false;
depth = true;
stencil = false;
mip = 0;
slice = 0;
minrange = 0.0f;
+8 -9
View File
@@ -410,19 +410,19 @@ DOCUMENT("Information about the a new capture created by the target.");
struct NewCaptureData
{
DOCUMENT("An identifier to use to refer to this capture.");
uint32_t ID;
uint32_t ID = 0;
DOCUMENT("The time the capture was created, as a unix timestamp in UTC.");
uint64_t timestamp;
uint64_t timestamp = 0;
DOCUMENT("The raw bytes that contain the capture thumbnail, as RGB8 data.");
bytebuf thumbnail;
DOCUMENT("The width of the image contained in :data:`thumbnail`.");
int32_t thumbWidth;
int32_t thumbWidth = 0;
DOCUMENT("The height of the image contained in :data:`thumbnail`.");
int32_t thumbHeight;
int32_t thumbHeight = 0;
DOCUMENT("The local path on the target system where the capture is saved.");
rdcstr path;
DOCUMENT("``True`` if the target is running on the local system.");
bool local;
bool local = true;
};
DECLARE_REFLECTION_STRUCT(NewCaptureData);
@@ -449,9 +449,9 @@ DOCUMENT("Information about a new child process spawned by the target.");
struct NewChildData
{
DOCUMENT("The PID (Process ID) of the new child.");
uint32_t PID;
uint32_t PID = 0;
DOCUMENT("The ident where the new child's target control is active.");
uint32_t ident;
uint32_t ident = 0;
};
DECLARE_REFLECTION_STRUCT(NewChildData);
@@ -459,9 +459,8 @@ DECLARE_REFLECTION_STRUCT(NewChildData);
DOCUMENT("A message from a target control connection.");
struct TargetControlMessage
{
TargetControlMessage() {}
DOCUMENT("The :class:`type <TargetControlMessageType>` of message received");
TargetControlMessageType Type;
TargetControlMessageType Type = TargetControlMessageType::Unknown;
DOCUMENT("The :class:`new capture data <NewCaptureData>`.");
NewCaptureData NewCapture;
+4 -4
View File
@@ -930,23 +930,23 @@ DOCUMENT("Gives some API-specific information about the capture.");
struct APIProperties
{
DOCUMENT("The :class:`GraphicsAPI` of the actual log/capture.");
GraphicsAPI pipelineType;
GraphicsAPI pipelineType = GraphicsAPI::D3D11;
DOCUMENT(R"(The :class:`GraphicsAPI` used to render the log. For remote replay this could be
different to the above, and lets the UI make decisions e.g. to flip rendering of images.
)");
GraphicsAPI localRenderer;
GraphicsAPI localRenderer = GraphicsAPI::D3D11;
DOCUMENT(R"(``True`` if the capture was loaded successfully but running in a degraded mode - e.g.
with software rendering, or with some functionality disabled due to lack of support.
)");
bool degraded;
bool degraded = false;
DOCUMENT(R"(``True`` if the driver mutates shader reflection structures from event to event.
Currently this is only true for OpenGL where the superfluous indirect in the binding model must be
worked around by re-sorting bindings.
)");
bool shadersMutable;
bool shadersMutable = false;
};
DECLARE_REFLECTION_STRUCT(APIProperties);
+1 -1
View File
@@ -308,7 +308,7 @@ public:
{
}
InitialContentData()
: resource((WrappedResourceType)RecordType::NullResource), num(0), blob(NULL)
: resourceType(0), resource((WrappedResourceType)RecordType::NullResource), num(0), blob(NULL)
{
}
uint32_t resourceType;
+2 -2
View File
@@ -351,8 +351,8 @@ private:
return E_FAIL;
}
PFNNVCreateDevice nvapi_CreateDevice_real;
PFNNVCreateDeviceAndSwapChain nvapi_CreateDeviceAndSwapChain_real;
PFNNVCreateDevice nvapi_CreateDevice_real = NULL;
PFNNVCreateDeviceAndSwapChain nvapi_CreateDeviceAndSwapChain_real = NULL;
static HRESULT WINAPI nvapi_CreateDevice(IDXGIAdapter *pAdapter, D3D_DRIVER_TYPE DriverType,
HMODULE Software, UINT Flags,
+2 -2
View File
@@ -55,7 +55,7 @@ void D3D11Replay::Shutdown()
TextureDescription D3D11Replay::GetTexture(ResourceId id)
{
TextureDescription tex;
TextureDescription tex = {};
tex.ID = ResourceId();
auto it1D = WrappedID3D11Texture1D::m_TextureList.find(id);
@@ -355,7 +355,7 @@ std::vector<ResourceId> D3D11Replay::GetBuffers()
BufferDescription D3D11Replay::GetBuffer(ResourceId id)
{
BufferDescription ret;
BufferDescription ret = {};
ret.ID = ResourceId();
auto it = WrappedID3D11Buffer::m_BufferList.find(id);
@@ -672,6 +672,7 @@ WrappedID3D12GraphicsCommandList::WrappedID3D12GraphicsCommandList(ID3D12Graphic
m_Cmd = NULL;
m_CurGfxRootSig = NULL;
m_CurCompRootSig = NULL;
if(!RenderDoc::Inst().IsReplayApp())
{
@@ -857,11 +858,15 @@ D3D12CommandData::D3D12CommandData()
{
m_CurChunkOffset = 0;
m_IndirectOffset = 0;
m_RootEventID = 1;
m_RootDrawcallID = 1;
m_FirstEventID = 0;
m_LastEventID = ~0U;
m_StructuredFile = NULL;
m_pDevice = NULL;
m_DrawcallCallback = NULL;
+10 -11
View File
@@ -268,26 +268,25 @@ struct D3D12RootSignatureParameter : D3D12_ROOT_PARAMETER1
}
}
vector<D3D12_DESCRIPTOR_RANGE1> ranges;
std::vector<D3D12_DESCRIPTOR_RANGE1> ranges;
};
struct D3D12RootSignature
{
D3D12RootSignature() : numSpaces(0) {}
uint32_t numSpaces;
uint32_t dwordLength;
uint32_t numSpaces = 0;
uint32_t dwordLength = 0;
D3D12_ROOT_SIGNATURE_FLAGS Flags;
vector<D3D12RootSignatureParameter> params;
vector<D3D12_STATIC_SAMPLER_DESC> samplers;
D3D12_ROOT_SIGNATURE_FLAGS Flags = D3D12_ROOT_SIGNATURE_FLAG_NONE;
std::vector<D3D12RootSignatureParameter> params;
std::vector<D3D12_STATIC_SAMPLER_DESC> samplers;
};
struct D3D12CommandSignature
{
bool graphics;
UINT numDraws;
UINT ByteStride;
vector<D3D12_INDIRECT_ARGUMENT_DESC> arguments;
bool graphics = true;
UINT numDraws = 0;
UINT ByteStride = 0;
std::vector<D3D12_INDIRECT_ARGUMENT_DESC> arguments;
};
#define IMPLEMENT_IUNKNOWN_WITH_REFCOUNTER_CUSTOMQUERY \
+3
View File
@@ -106,6 +106,9 @@ D3D12DebugManager::D3D12DebugManager(WrappedID3D12Device *wrapper)
m_width = m_height = 1;
m_BBFmtIdx = BGRA8_BACKBUFFER;
RDCEraseEl(m_TileMinMaxPipe);
RDCEraseEl(m_HistogramPipe);
RenderDoc::Inst().SetProgress(DebugManagerInit, 0.0f);
m_pFactory = NULL;
+39 -39
View File
@@ -241,60 +241,60 @@ private:
float CharSize;
} m_Font;
ID3D12DescriptorHeap *cbvsrvuavHeap;
ID3D12DescriptorHeap *uavClearHeap;
ID3D12DescriptorHeap *samplerHeap;
ID3D12DescriptorHeap *rtvHeap;
ID3D12DescriptorHeap *dsvHeap;
ID3D12DescriptorHeap *cbvsrvuavHeap = NULL;
ID3D12DescriptorHeap *uavClearHeap = NULL;
ID3D12DescriptorHeap *samplerHeap = NULL;
ID3D12DescriptorHeap *rtvHeap = NULL;
ID3D12DescriptorHeap *dsvHeap = NULL;
ID3D12Resource *m_RingConstantBuffer;
UINT64 m_RingConstantOffset;
ID3D12Resource *m_RingConstantBuffer = NULL;
UINT64 m_RingConstantOffset = 0;
ID3D12PipelineState *m_TexDisplayPipe;
ID3D12PipelineState *m_TexDisplayLinearPipe;
ID3D12PipelineState *m_TexDisplayF32Pipe;
ID3D12PipelineState *m_TexDisplayBlendPipe;
ID3DBlob *m_GenericVS;
ID3D12PipelineState *m_TexDisplayPipe = NULL;
ID3D12PipelineState *m_TexDisplayLinearPipe = NULL;
ID3D12PipelineState *m_TexDisplayF32Pipe = NULL;
ID3D12PipelineState *m_TexDisplayBlendPipe = NULL;
ID3DBlob *m_GenericVS = NULL;
ID3D12RootSignature *m_TexDisplayRootSig;
ID3D12RootSignature *m_TexDisplayRootSig = NULL;
ID3D12RootSignature *m_CBOnlyRootSig;
ID3D12PipelineState *m_CheckerboardPipe;
ID3D12PipelineState *m_CheckerboardMSAAPipe;
ID3D12PipelineState *m_OutlinePipe;
ID3D12RootSignature *m_CBOnlyRootSig = NULL;
ID3D12PipelineState *m_CheckerboardPipe = NULL;
ID3D12PipelineState *m_CheckerboardMSAAPipe = NULL;
ID3D12PipelineState *m_OutlinePipe = NULL;
ID3DBlob *m_QuadOverdrawWritePS;
ID3D12RootSignature *m_QuadResolveRootSig;
ID3D12PipelineState *m_QuadResolvePipe;
ID3DBlob *m_QuadOverdrawWritePS = NULL;
ID3D12RootSignature *m_QuadResolveRootSig = NULL;
ID3D12PipelineState *m_QuadResolvePipe = NULL;
ID3D12Resource *m_PickPixelTex;
D3D12_CPU_DESCRIPTOR_HANDLE m_PickPixelRTV;
ID3D12Resource *m_PickPixelTex = NULL;
D3D12_CPU_DESCRIPTOR_HANDLE m_PickPixelRTV = {0};
ID3D12RootSignature *m_MeshPickRootSig;
ID3D12PipelineState *m_MeshPickPipe;
ID3D12RootSignature *m_MeshPickRootSig = NULL;
ID3D12PipelineState *m_MeshPickPipe = NULL;
ID3D12RootSignature *m_HistogramRootSig;
ID3D12RootSignature *m_HistogramRootSig = NULL;
// one per texture type, one per int/uint/float
ID3D12PipelineState *m_TileMinMaxPipe[10][3];
ID3D12PipelineState *m_HistogramPipe[10][3];
// one per int/uint/float
ID3D12PipelineState *m_ResultMinMaxPipe[3];
ID3D12Resource *m_MinMaxResultBuffer;
ID3D12Resource *m_MinMaxTileBuffer;
ID3D12Resource *m_MinMaxResultBuffer = NULL;
ID3D12Resource *m_MinMaxTileBuffer = NULL;
ID3D12GraphicsCommandList *m_DebugList;
ID3D12CommandAllocator *m_DebugAlloc;
ID3D12Resource *m_ReadbackBuffer;
ID3D12GraphicsCommandList *m_DebugList = NULL;
ID3D12CommandAllocator *m_DebugAlloc = NULL;
ID3D12Resource *m_ReadbackBuffer = NULL;
ID3DBlob *m_MeshVS;
ID3DBlob *m_MeshGS;
ID3DBlob *m_MeshPS;
ID3DBlob *m_TriangleSizeGS;
ID3DBlob *m_TriangleSizePS;
ID3DBlob *m_MeshVS = NULL;
ID3DBlob *m_MeshGS = NULL;
ID3DBlob *m_MeshPS = NULL;
ID3DBlob *m_TriangleSizeGS = NULL;
ID3DBlob *m_TriangleSizePS = NULL;
ID3D12Resource *m_TexResource;
ID3D12Resource *m_TexResource = NULL;
ID3D12Resource *m_OverlayRenderTex;
ID3D12Resource *m_OverlayRenderTex = NULL;
ResourceId m_OverlayResourceId;
static const uint64_t m_ReadbackSize = 16 * 1024 * 1024;
@@ -302,8 +302,8 @@ private:
static const uint32_t m_ShaderCacheMagic = 0xbaafd1d1;
static const uint32_t m_ShaderCacheVersion = 1;
bool m_ShaderCacheDirty, m_CacheShaders;
map<uint32_t, ID3DBlob *> m_ShaderCache;
bool m_ShaderCacheDirty = false, m_CacheShaders = false;
std::map<uint32_t, ID3DBlob *> m_ShaderCache;
void FillCBufferVariables(const string &prefix, size_t &offset, bool flatten,
const vector<DXBC::CBufferVariable> &invars,
+5 -2
View File
@@ -178,12 +178,15 @@ WrappedID3D12Device::WrappedID3D12Device(ID3D12Device *realDevice, D3D12InitPara
m_HeaderChunk = NULL;
m_Alloc = NULL;
m_List = NULL;
m_Alloc = m_DataUploadAlloc = NULL;
m_List = m_DataUploadList = NULL;
m_GPUSyncFence = NULL;
m_GPUSyncHandle = NULL;
m_GPUSyncCounter = 0;
initStateCurBatch = 0;
initStateCurList = NULL;
if(RenderDoc::Inst().IsReplayApp())
{
m_State = CaptureState::LoadingReplaying;
+2 -2
View File
@@ -134,7 +134,7 @@ std::vector<ResourceId> D3D12Replay::GetTextures()
BufferDescription D3D12Replay::GetBuffer(ResourceId id)
{
BufferDescription ret;
BufferDescription ret = {};
ret.ID = m_pDevice->GetResourceManager()->GetOriginalID(id);
auto it = WrappedID3D12Resource::GetList().find(id);
@@ -175,7 +175,7 @@ BufferDescription D3D12Replay::GetBuffer(ResourceId id)
TextureDescription D3D12Replay::GetTexture(ResourceId id)
{
TextureDescription ret;
TextureDescription ret = {};
ret.ID = m_pDevice->GetResourceManager()->GetOriginalID(id);
auto it = WrappedID3D12Resource::GetList().find(id);
+2 -2
View File
@@ -70,7 +70,7 @@ public:
DWORD m_fvf;
int m_width;
int m_height;
int m_width = 0;
int m_height = 0;
WrappedD3DDevice8 *m_WrappedDevice;
};
+2
View File
@@ -64,6 +64,8 @@ WrappedD3DDevice8::WrappedD3DDevice8(IDirect3DDevice8 *device, HWND wnd,
else
{
m_State = CaptureState::LoadingReplaying;
m_Wnd = NULL;
}
m_ResourceManager = new D3D8ResourceManager(this);
+5 -1
View File
@@ -30,7 +30,11 @@
class TrackedResource8
{
public:
TrackedResource8() { m_ID = ResourceIDGen::GetNewUniqueID(); }
TrackedResource8()
{
m_ID = ResourceIDGen::GetNewUniqueID();
m_pRecord = NULL;
}
ResourceId GetResourceID() { return m_ID; }
D3D8ResourceRecord *GetResourceRecord() { return m_pRecord; }
void SetResourceRecord(D3D8ResourceRecord *record) { m_pRecord = record; }
+2 -2
View File
@@ -70,7 +70,7 @@ public:
DWORD m_fvf;
int m_width;
int m_height;
int m_width = 0;
int m_height = 0;
WrappedD3DDevice9 *m_WrappedDevice;
};
+4
View File
@@ -50,6 +50,10 @@ WrappedD3DDevice9::WrappedD3DDevice9(IDirect3DDevice9 *device, HWND wnd)
if(wnd != NULL)
RenderDoc::Inst().AddFrameCapturer((IDirect3DDevice9 *)this, wnd, this);
}
else
{
m_Wnd = NULL;
}
}
void WrappedD3DDevice9::CheckForDeath()
+1 -1
View File
@@ -173,7 +173,7 @@ private:
set<ResourceId> m_HighTrafficResources;
int m_ReplayEventCount;
int m_ReplayEventCount = 0;
// we store two separate sets of maps, since for an explicit glMemoryBarrier
// we need to flush both types of maps, but for implicit sync points we only
+1 -1
View File
@@ -1390,7 +1390,7 @@ bool GLResourceManager::Serialise_InitialState(SerialiserType &ser, ResourceId r
gl.glGetTextureParameterivEXT(res.name, TextureState.type, eGL_TEXTURE_IMMUTABLE_FORMAT,
&immut);
GLenum dummy;
GLenum dummy = eGL_RGBA;
EmulateLuminanceFormat(gl, res.name, TextureState.type, TextureState.internalformat, dummy);
if(immut == 0)
+5
View File
@@ -27,6 +27,11 @@
#include <algorithm>
#include "driver/gl/gl_driver.h"
GLResourceManager::GLResourceManager(WrappedOpenGL *gl) : ResourceManager(), m_GL(gl), m_SyncName(1)
{
m_State = m_GL->GetState();
}
void GLResourceManager::MarkVAOReferenced(GLResource res, FrameRefType ref, bool allowFake0)
{
const GLHookSet &gl = m_GL->GetHookset();
+1 -1
View File
@@ -33,7 +33,7 @@ class WrappedOpenGL;
class GLResourceManager : public ResourceManager<GLResource, GLResource, GLResourceRecord>
{
public:
GLResourceManager(WrappedOpenGL *gl) : ResourceManager(), m_GL(gl), m_SyncName(1) {}
GLResourceManager(WrappedOpenGL *gl);
~GLResourceManager() {}
void Shutdown()
{
+2 -2
View File
@@ -468,7 +468,7 @@ TextureDescription GLReplay::GetTexture(ResourceId id)
void GLReplay::CacheTexture(ResourceId id)
{
TextureDescription tex;
TextureDescription tex = {};
MakeCurrentReplayContext(&m_ReplayCtx);
@@ -700,7 +700,7 @@ void GLReplay::CacheTexture(ResourceId id)
BufferDescription GLReplay::GetBuffer(ResourceId id)
{
BufferDescription ret;
BufferDescription ret = {};
MakeCurrentReplayContext(&m_ReplayCtx);
+7 -7
View File
@@ -256,11 +256,11 @@ private:
struct
{
// used to blit from defined FBO (VAOs not shared)
GLuint emptyVAO;
GLuint emptyVAO = 0;
// textures for the below FBO. Resize with the window
GLuint backbuffer;
GLuint depthstencil;
GLuint backbuffer = 0;
GLuint depthstencil = 0;
// this FBO is on the debug GL context, not the window's GL context
// when rendering a texture or mesh etc, we render onto this FBO on
@@ -268,18 +268,18 @@ private:
// on the window's GL context.
// This is so we don't have to re-create any non-shared resource we
// need for debug rendering on the window's GL context.
GLuint windowFBO;
GLuint windowFBO = 0;
// this FBO is the same as the above, but on the replay context,
// for any cases where we need to use the replay context (like
// re-rendering a draw).
GLuint replayFBO;
GLuint replayFBO = 0;
// read FBO for blit to window
GLuint readFBO;
GLuint readFBO = 0;
} BlitData;
int width, height;
int width = 1, height = 1;
};
// any objects that are shared between contexts, we just initialise
+1
View File
@@ -211,6 +211,7 @@ struct GLResourceRecord : public ResourceRecord
{
RDCEraseEl(ShadowPtr);
RDCEraseEl(Map);
ShadowSize = 0;
}
~GLResourceRecord() { FreeShadowStorage(); }
@@ -61,6 +61,7 @@ struct PushPop
{
vao = bindFunc;
other = NULL;
t = eGL_NONE;
hookset->glGetIntegerv(eGL_VERTEX_ARRAY_BINDING, (GLint *)&o);
}
@@ -822,14 +822,17 @@ struct ASMDecl
declaration = NUM_OPCODES;
refactoringAllowed = doublePrecisionFloats = forceEarlyDepthStencil =
enableRawAndStructuredBuffers = skipOptimisation = enableMinPrecision =
enableD3D11_1DoubleExtensions = enableD3D11_1ShaderExtensions = false;
enableD3D11_1DoubleExtensions = enableD3D11_1ShaderExtensions =
enableD3D12AllResourcesBound = false;
stride = 0;
hasCounter = false;
rov = false;
numTemps = 0;
tempReg = 0;
tempComponentCount = 0;
count = 0;
groupSize[0] = groupSize[1] = groupSize[2] = 0;
space = 0;
resType[0] = resType[1] = resType[2] = resType[3] = NUM_RETURN_TYPES;
dim = RESOURCE_DIMENSION_UNKNOWN;
sampleCount = 0;
@@ -538,6 +538,11 @@ DXBCFile::DXBCFile(const void *ByteCode, size_t ByteCodeLength)
m_Disassembled = false;
m_Type = D3D11_ShaderType_Vertex;
m_Version.Major = 5;
m_Version.Minor = 0;
m_GuessedResources = true;
RDCASSERT(ByteCodeLength < UINT32_MAX);
RDCEraseEl(m_ShaderStats);
+11 -10
View File
@@ -409,43 +409,44 @@ private:
curEventID(0),
drawCount(0),
level(VK_COMMAND_BUFFER_LEVEL_PRIMARY),
beginFlags(0)
beginFlags(0),
markerCount(0)
{
}
~BakedCmdBufferInfo() { SAFE_DELETE(draw); }
vector<APIEvent> curEvents;
vector<DebugMessage> debugMessages;
list<VulkanDrawcallTreeNode *> drawStack;
std::list<VulkanDrawcallTreeNode *> drawStack;
VkCommandBufferLevel level;
VkCommandBufferUsageFlags beginFlags;
int markerCount;
vector<pair<ResourceId, EventUsage> > resourceUsage;
std::vector<std::pair<ResourceId, EventUsage> > resourceUsage;
struct CmdBufferState
{
CmdBufferState() : idxWidth(0), subpass(0) {}
ResourceId pipeline;
struct DescriptorAndOffsets
{
ResourceId descSet;
vector<uint32_t> offsets;
std::vector<uint32_t> offsets;
};
vector<DescriptorAndOffsets> graphicsDescSets, computeDescSets;
std::vector<DescriptorAndOffsets> graphicsDescSets, computeDescSets;
uint32_t idxWidth;
uint32_t idxWidth = 0;
ResourceId ibuffer;
vector<ResourceId> vbuffers;
std::vector<ResourceId> vbuffers;
ResourceId renderPass;
ResourceId framebuffer;
uint32_t subpass;
uint32_t subpass = 0;
} state;
vector<pair<ResourceId, ImageRegionState> > imgbarriers;
std::vector<std::pair<ResourceId, ImageRegionState> > imgbarriers;
VulkanDrawcallTreeNode *draw; // the root draw to copy from when submitting
uint32_t eventCount; // how many events are in this cmd buffer, for quick skipping
+5 -3
View File
@@ -808,7 +808,7 @@ TextureDescription VulkanReplay::GetTexture(ResourceId id)
{
VulkanCreationInfo::Image &iminfo = m_pDriver->m_CreationInfo.m_Image[id];
TextureDescription ret;
TextureDescription ret = {};
ret.ID = m_pDriver->GetResourceManager()->GetOriginalID(id);
ret.arraysize = iminfo.arrayLayers;
ret.creationFlags = iminfo.creationFlags;
@@ -847,7 +847,10 @@ TextureDescription VulkanReplay::GetTexture(ResourceId id)
ret.resType = TextureDim::Texture3D;
ret.dimension = 3;
break;
default: RDCERR("Unexpected image type"); break;
default:
ret.dimension = 2;
RDCERR("Unexpected image type");
break;
}
return ret;
@@ -860,7 +863,6 @@ BufferDescription VulkanReplay::GetBuffer(ResourceId id)
BufferDescription ret;
ret.ID = m_pDriver->GetResourceManager()->GetOriginalID(id);
ret.length = bufinfo.size;
ret.creationFlags = BufferCategory::NoFlags;
if(bufinfo.usage & (VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT))
+9
View File
@@ -1078,6 +1078,15 @@ public:
// so just pack/unpack into bitfields
struct ViewRange
{
ViewRange()
{
aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
baseMipLevel = 0;
levelCount = 1;
baseArrayLayer = 0;
layerCount = 1;
}
ViewRange &operator=(const VkImageSubresourceRange &range)
{
aspectMask = (uint32_t)range.aspectMask;
+1
View File
@@ -78,6 +78,7 @@ public:
LibraryHooks::GetInstance().RegisterHook(DLL_NAME, this);
m_EnabledHooks = true;
m_HasHooks = false;
m_WSARefCount = 1;
}
bool CreateHooks(const char *libName)
+5
View File
@@ -171,6 +171,11 @@ ReplayController::ReplayController()
m_pDevice = NULL;
m_EventID = 100000;
m_D3D11PipelineState = NULL;
m_D3D12PipelineState = NULL;
m_GLPipelineState = NULL;
m_VulkanPipelineState = NULL;
}
ReplayController::~ReplayController()