mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-26 07:35:37 +00:00
Switch buffer offsets and lengths to 64-bit, downcast only where needed
This commit is contained in:
@@ -32,11 +32,11 @@ struct OutputConfig
|
||||
struct MeshFormat
|
||||
{
|
||||
ResourceId idxbuf;
|
||||
uint32_t idxoffs;
|
||||
uint64_t idxoffs;
|
||||
uint32_t idxByteWidth;
|
||||
|
||||
ResourceId buf;
|
||||
uint32_t offset;
|
||||
uint64_t offset;
|
||||
uint32_t stride;
|
||||
|
||||
uint32_t compCount;
|
||||
|
||||
@@ -207,7 +207,7 @@ struct IReplayRenderer
|
||||
|
||||
virtual bool GetUsage(ResourceId id, rdctype::array<EventUsage> *usage) = 0;
|
||||
|
||||
virtual bool GetCBufferVariableContents(ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint32_t offs, rdctype::array<ShaderVariable> *vars) = 0;
|
||||
virtual bool GetCBufferVariableContents(ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint64_t offs, rdctype::array<ShaderVariable> *vars) = 0;
|
||||
|
||||
virtual bool SaveTexture(const TextureSave &saveData, const char *path) = 0;
|
||||
|
||||
@@ -216,7 +216,7 @@ struct IReplayRenderer
|
||||
virtual bool GetMinMax(ResourceId tex, uint32_t sliceFace, uint32_t mip, uint32_t sample, PixelValue *minval, PixelValue *maxval) = 0;
|
||||
virtual bool GetHistogram(ResourceId tex, uint32_t sliceFace, uint32_t mip, uint32_t sample, float minval, float maxval, bool channels[4], rdctype::array<uint32_t> *histogram) = 0;
|
||||
|
||||
virtual bool GetBufferData(ResourceId buff, uint32_t offset, uint32_t len, rdctype::array<byte> *data) = 0;
|
||||
virtual bool GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, rdctype::array<byte> *data) = 0;
|
||||
virtual bool GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, rdctype::array<byte> *data) = 0;
|
||||
};
|
||||
|
||||
@@ -275,7 +275,7 @@ extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_DebugThread(ReplayRe
|
||||
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetUsage(ReplayRenderer *rend, ResourceId id, rdctype::array<EventUsage> *usage);
|
||||
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetCBufferVariableContents(ReplayRenderer *rend, ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint32_t offs, rdctype::array<ShaderVariable> *vars);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetCBufferVariableContents(ReplayRenderer *rend, ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint64_t offs, rdctype::array<ShaderVariable> *vars);
|
||||
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_SaveTexture(ReplayRenderer *rend, const TextureSave &saveData, const char *path);
|
||||
|
||||
@@ -284,7 +284,7 @@ extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetPostVSData(Replay
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetMinMax(ReplayRenderer *rend, ResourceId tex, uint32_t sliceFace, uint32_t mip, uint32_t sample, PixelValue *minval, PixelValue *maxval);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetHistogram(ReplayRenderer *rend, ResourceId tex, uint32_t sliceFace, uint32_t mip, uint32_t sample, float minval, float maxval, bool32 channels[4], rdctype::array<uint32_t> *histogram);
|
||||
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetBufferData(ReplayRenderer *rend, ResourceId buff, uint32_t offset, uint32_t len, rdctype::array<byte> *data);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetBufferData(ReplayRenderer *rend, ResourceId buff, uint64_t offset, uint64_t len, rdctype::array<byte> *data);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetTextureData(ReplayRenderer *rend, ResourceId tex, uint32_t arrayIdx, uint32_t mip, rdctype::array<byte> *data);
|
||||
|
||||
// for C++ expose the interface as a virtual interface
|
||||
|
||||
@@ -127,7 +127,7 @@ class ImageViewer : public IReplayDriver
|
||||
void DescribeCounter(uint32_t counterID, CounterDescription &desc) { RDCEraseEl(desc); desc.counterID = counterID; }
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters) { return vector<CounterResult>(); }
|
||||
void FillCBufferVariables(ResourceId shader, uint32_t cbufSlot, vector<ShaderVariable> &outvars, const vector<byte> &data) {}
|
||||
vector<byte> GetBufferData(ResourceId buff, uint32_t offset, uint32_t len) { return vector<byte>(); }
|
||||
vector<byte> GetBufferData(ResourceId buff, uint64_t offset, uint64_t len) { return vector<byte>(); }
|
||||
void InitPostVSBuffers(uint32_t frameID, uint32_t eventID) {}
|
||||
MeshFormat GetPostVSBuffers(uint32_t frameID, uint32_t eventID, uint32_t instID, MeshDataStage stage) { MeshFormat ret; RDCEraseEl(ret); return ret; }
|
||||
ResourceId RenderOverlay(ResourceId texid, TextureDisplayOverlay overlay, uint32_t frameID, uint32_t eventID, const vector<uint32_t> &passEvents) { return ResourceId(); }
|
||||
|
||||
@@ -1798,7 +1798,7 @@ void ProxySerialiser::FillCBufferVariables(ResourceId shader, uint32_t cbufSlot,
|
||||
return;
|
||||
}
|
||||
|
||||
vector<byte> ProxySerialiser::GetBufferData(ResourceId buff, uint32_t offset, uint32_t len)
|
||||
vector<byte> ProxySerialiser::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len)
|
||||
{
|
||||
vector<byte> ret;
|
||||
|
||||
|
||||
@@ -347,7 +347,7 @@ class ProxySerialiser : public IReplayDriver, Callstack::StackResolver
|
||||
|
||||
void FillCBufferVariables(ResourceId shader, uint32_t cbufSlot, vector<ShaderVariable> &outvars, const vector<byte> &data);
|
||||
|
||||
vector<byte> GetBufferData(ResourceId buff, uint32_t offset, uint32_t len);
|
||||
vector<byte> GetBufferData(ResourceId buff, uint64_t offset, uint64_t len);
|
||||
byte *GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, bool resolve, bool forceRGBA8unorm, float blackPoint, float whitePoint, size_t &dataSize);
|
||||
|
||||
void InitPostVSBuffers(uint32_t frameID, uint32_t eventID);
|
||||
|
||||
@@ -2097,11 +2097,13 @@ uint32_t D3D11DebugManager::PickVertex(uint32_t frameID, uint32_t eventID, MeshD
|
||||
|
||||
// copy index data as-is, the view format will take care of the rest
|
||||
|
||||
RDCASSERT(cfg.position.idxoffs < 0xffffffff);
|
||||
|
||||
D3D11_BOX box;
|
||||
box.front = 0;
|
||||
box.back = 1;
|
||||
box.left = cfg.position.idxoffs;
|
||||
box.right = cfg.position.idxoffs + cfg.position.numVerts*cfg.position.idxByteWidth;
|
||||
box.left = (uint32_t)cfg.position.idxoffs;
|
||||
box.right = (uint32_t)cfg.position.idxoffs + cfg.position.numVerts*cfg.position.idxByteWidth;
|
||||
box.top = 0;
|
||||
box.bottom = 1;
|
||||
|
||||
|
||||
@@ -2121,7 +2121,7 @@ bool D3D11DebugManager::GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t
|
||||
return true;
|
||||
}
|
||||
|
||||
vector<byte> D3D11DebugManager::GetBufferData(ResourceId buff, uint32_t offset, uint32_t len)
|
||||
vector<byte> D3D11DebugManager::GetBufferData(ResourceId buff, uint64_t offset, uint64_t length)
|
||||
{
|
||||
auto it = WrappedID3D11Buffer::m_BufferList.find(buff);
|
||||
|
||||
@@ -2132,28 +2132,34 @@ vector<byte> D3D11DebugManager::GetBufferData(ResourceId buff, uint32_t offset,
|
||||
|
||||
RDCASSERT(buffer);
|
||||
|
||||
return GetBufferData(buffer, offset, len, true);
|
||||
return GetBufferData(buffer, offset, length, true);
|
||||
}
|
||||
|
||||
vector<byte> D3D11DebugManager::GetBufferData(ID3D11Buffer *buffer, uint32_t offset, uint32_t len, bool unwrap)
|
||||
vector<byte> D3D11DebugManager::GetBufferData(ID3D11Buffer *buffer, uint64_t offset, uint64_t length, bool unwrap)
|
||||
{
|
||||
D3D11_MAPPED_SUBRESOURCE mapped;
|
||||
|
||||
if(buffer == NULL)
|
||||
return vector<byte>();
|
||||
|
||||
RDCASSERT(offset < 0xffffffff);
|
||||
RDCASSERT(length <= 0xffffffff);
|
||||
|
||||
uint32_t offs = (uint32_t)offset;
|
||||
uint32_t len = (uint32_t)length;
|
||||
|
||||
D3D11_BUFFER_DESC desc;
|
||||
buffer->GetDesc(&desc);
|
||||
|
||||
if(len == 0)
|
||||
{
|
||||
len = desc.ByteWidth-offset;
|
||||
len = desc.ByteWidth-offs;
|
||||
}
|
||||
|
||||
if(len > 0 && offset+len > desc.ByteWidth)
|
||||
if(len > 0 && offs+len > desc.ByteWidth)
|
||||
{
|
||||
RDCWARN("Attempting to read off the end of the array. Will be clamped");
|
||||
len = RDCMIN(len, desc.ByteWidth-offset);
|
||||
len = RDCMIN(len, desc.ByteWidth-offs);
|
||||
}
|
||||
|
||||
uint32_t outOffs = 0;
|
||||
@@ -2177,8 +2183,8 @@ vector<byte> D3D11DebugManager::GetBufferData(ID3D11Buffer *buffer, uint32_t off
|
||||
if(desc.StructureByteStride > 0)
|
||||
chunkSize -= (chunkSize % desc.StructureByteStride);
|
||||
|
||||
box.left = RDCMIN(offset + outOffs, desc.ByteWidth);
|
||||
box.right = RDCMIN(offset + outOffs + chunkSize, desc.ByteWidth);
|
||||
box.left = RDCMIN(offs + outOffs, desc.ByteWidth);
|
||||
box.right = RDCMIN(offs + outOffs + chunkSize, desc.ByteWidth);
|
||||
|
||||
if(box.right-box.left == 0)
|
||||
break;
|
||||
@@ -4711,10 +4717,12 @@ void D3D11DebugManager::RenderMesh(uint32_t frameID, uint32_t eventID, const vec
|
||||
|
||||
m_PrevMeshFmt = resFmt;
|
||||
m_PrevMeshFmt2 = resFmt2;
|
||||
|
||||
RDCASSERT(cfg.position.idxoffs < 0xffffffff);
|
||||
|
||||
ID3D11Buffer *ibuf = NULL;
|
||||
DXGI_FORMAT ifmt = DXGI_FORMAT_R16_UINT;
|
||||
UINT ioffs = cfg.position.idxoffs;
|
||||
UINT ioffs = (UINT)cfg.position.idxoffs;
|
||||
|
||||
D3D11_PRIMITIVE_TOPOLOGY topo = MakeD3D11PrimitiveTopology(cfg.position.topo);
|
||||
|
||||
@@ -4776,9 +4784,11 @@ void D3D11DebugManager::RenderMesh(uint32_t frameID, uint32_t eventID, const vec
|
||||
m_pImmediateContext->IASetVertexBuffers(0, 1, &buf, (UINT *)&fmt.stride, (UINT *)&fmt.offset);
|
||||
if(fmt.idxbuf != ResourceId())
|
||||
{
|
||||
RDCASSERT(fmt.idxoffs < 0xffffffff);
|
||||
|
||||
it = WrappedID3D11Buffer::m_BufferList.find(fmt.idxbuf);
|
||||
buf = UNWRAP(WrappedID3D11Buffer, it->second.m_Buffer);
|
||||
m_pImmediateContext->IASetIndexBuffer(buf, fmt.idxByteWidth == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT, fmt.idxoffs);
|
||||
m_pImmediateContext->IASetIndexBuffer(buf, fmt.idxByteWidth == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT, (UINT)fmt.idxoffs);
|
||||
|
||||
m_pImmediateContext->DrawIndexed(fmt.numVerts, 0, 0);
|
||||
}
|
||||
@@ -4799,10 +4809,12 @@ void D3D11DebugManager::RenderMesh(uint32_t frameID, uint32_t eventID, const vec
|
||||
}
|
||||
|
||||
m_pImmediateContext->IASetInputLayout(layout);
|
||||
|
||||
RDCASSERT(cfg.position.offset < 0xffffffff && cfg.second.offset < 0xffffffff);
|
||||
|
||||
ID3D11Buffer *vbs[2] = { NULL, NULL };
|
||||
UINT str[] = { cfg.position.stride, cfg.second.stride };
|
||||
UINT offs[] = { cfg.position.offset, cfg.second.offset };
|
||||
UINT offs[] = { (UINT)cfg.position.offset, (UINT)cfg.second.offset };
|
||||
|
||||
{
|
||||
auto it = WrappedID3D11Buffer::m_BufferList.find(cfg.position.buf);
|
||||
@@ -4943,9 +4955,11 @@ void D3D11DebugManager::RenderMesh(uint32_t frameID, uint32_t eventID, const vec
|
||||
if(m_HighlightCache.EID != eventID || stage != m_HighlightCache.stage ||
|
||||
cfg.position.buf != m_HighlightCache.buf || cfg.position.offset != m_HighlightCache.offs)
|
||||
{
|
||||
RDCASSERT(cfg.position.offset < 0xffffffff);
|
||||
|
||||
m_HighlightCache.EID = eventID;
|
||||
m_HighlightCache.buf = cfg.position.buf;
|
||||
m_HighlightCache.offs = cfg.position.offset;
|
||||
m_HighlightCache.offs = (uint32_t)cfg.position.offset;
|
||||
m_HighlightCache.stage = stage;
|
||||
|
||||
bool index16 = (ifmt == DXGI_FORMAT_R16_UINT);
|
||||
|
||||
@@ -119,8 +119,8 @@ class D3D11DebugManager
|
||||
MeshFormat GetPostVSBuffers(uint32_t frameID, uint32_t eventID, uint32_t instID, MeshDataStage stage);
|
||||
|
||||
uint32_t GetStructCount(ID3D11UnorderedAccessView *uav);
|
||||
vector<byte> GetBufferData(ResourceId buff, uint32_t offset, uint32_t len);
|
||||
vector<byte> GetBufferData(ID3D11Buffer *buff, uint32_t offset, uint32_t len, bool unwrap);
|
||||
vector<byte> GetBufferData(ResourceId buff, uint64_t offset, uint64_t length);
|
||||
vector<byte> GetBufferData(ID3D11Buffer *buff, uint64_t offset, uint64_t length, bool unwrap);
|
||||
|
||||
byte *GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, bool resolve, bool forceRGBA8unorm, float blackPoint, float whitePoint, size_t &dataSize);
|
||||
|
||||
|
||||
@@ -1281,7 +1281,7 @@ MeshFormat D3D11Replay::GetPostVSBuffers(uint32_t frameID, uint32_t eventID, uin
|
||||
return m_pDevice->GetDebugManager()->GetPostVSBuffers(frameID, eventID, instID, stage);
|
||||
}
|
||||
|
||||
vector<byte> D3D11Replay::GetBufferData(ResourceId buff, uint32_t offset, uint32_t len)
|
||||
vector<byte> D3D11Replay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len)
|
||||
{
|
||||
return m_pDevice->GetDebugManager()->GetBufferData(buff, offset, len);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class D3D11Replay : public IReplayDriver
|
||||
|
||||
MeshFormat GetPostVSBuffers(uint32_t frameID, uint32_t eventID, uint32_t instID, MeshDataStage stage);
|
||||
|
||||
vector<byte> GetBufferData(ResourceId buff, uint32_t offset, uint32_t len);
|
||||
vector<byte> GetBufferData(ResourceId buff, uint64_t offset, uint64_t len);
|
||||
byte *GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, bool resolve, bool forceRGBA8unorm, float blackPoint, float whitePoint, size_t &dataSize);
|
||||
|
||||
void BuildTargetShader(string source, string entry, const uint32_t compileFlags, ShaderStageType type, ResourceId *id, string *errors);
|
||||
|
||||
@@ -308,7 +308,7 @@ void GLReplay::FlipOutputWindow(uint64_t id)
|
||||
SwapBuffers(&outw);
|
||||
}
|
||||
|
||||
vector<byte> GLReplay::GetBufferData(ResourceId buff, uint32_t offset, uint32_t len)
|
||||
vector<byte> GLReplay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len)
|
||||
{
|
||||
vector<byte> ret;
|
||||
|
||||
@@ -320,14 +320,14 @@ vector<byte> GLReplay::GetBufferData(ResourceId buff, uint32_t offset, uint32_t
|
||||
|
||||
auto &buf = m_pDriver->m_Buffers[buff];
|
||||
|
||||
uint32_t bufsize = (uint32_t)buf.size;
|
||||
uint64_t bufsize = buf.size;
|
||||
|
||||
if(len > 0 && offset+len > buf.size)
|
||||
{
|
||||
RDCWARN("Attempting to read off the end of the array. Will be clamped");
|
||||
|
||||
if(offset < buf.size)
|
||||
len = ~0U; // min below will clamp to max size size
|
||||
len = ~0ULL; // min below will clamp to max size size
|
||||
else
|
||||
return ret; // offset past buffer size, return empty array
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ class GLReplay : public IReplayDriver
|
||||
|
||||
MeshFormat GetPostVSBuffers(uint32_t frameID, uint32_t eventID, uint32_t instID, MeshDataStage stage);
|
||||
|
||||
vector<byte> GetBufferData(ResourceId buff, uint32_t offset, uint32_t len);
|
||||
vector<byte> GetBufferData(ResourceId buff, uint64_t offset, uint64_t len);
|
||||
byte *GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, bool resolve, bool forceRGBA8unorm, float blackPoint, float whitePoint, size_t &dataSize);
|
||||
|
||||
void ReplaceResource(ResourceId from, ResourceId to);
|
||||
@@ -325,7 +325,7 @@ class GLReplay : public IReplayDriver
|
||||
HighlightCache() : EID(0), buf(), offs(0), stage(eMeshDataStage_Unknown), useidx(false) {}
|
||||
uint32_t EID;
|
||||
ResourceId buf;
|
||||
uint32_t offs;
|
||||
uint64_t offs;
|
||||
MeshDataStage stage;
|
||||
bool useidx;
|
||||
|
||||
|
||||
@@ -1222,7 +1222,7 @@ uint64_t VulkanReplay::MakeOutputWindow(void *wn, bool depth)
|
||||
return id;
|
||||
}
|
||||
|
||||
vector<byte> VulkanReplay::GetBufferData(ResourceId buff, uint32_t offset, uint32_t len)
|
||||
vector<byte> VulkanReplay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len)
|
||||
{
|
||||
VkDevice dev = m_pDriver->GetDev();
|
||||
VkCmdBuffer cmd = m_pDriver->GetNextCmd();
|
||||
@@ -1232,13 +1232,13 @@ vector<byte> VulkanReplay::GetBufferData(ResourceId buff, uint32_t offset, uint3
|
||||
|
||||
if(len == 0)
|
||||
{
|
||||
len = uint32_t(m_pDriver->m_CreationInfo.m_Buffer[buff].size - offset);
|
||||
len = m_pDriver->m_CreationInfo.m_Buffer[buff].size - offset;
|
||||
}
|
||||
|
||||
if(len > 0 && VkDeviceSize(offset+len) > m_pDriver->m_CreationInfo.m_Buffer[buff].size)
|
||||
{
|
||||
RDCWARN("Attempting to read off the end of the array. Will be clamped");
|
||||
len = RDCMIN(len, uint32_t(m_pDriver->m_CreationInfo.m_Buffer[buff].size - offset));
|
||||
len = RDCMIN(len, m_pDriver->m_CreationInfo.m_Buffer[buff].size - offset);
|
||||
}
|
||||
|
||||
vector<byte> ret;
|
||||
|
||||
@@ -122,7 +122,7 @@ class VulkanReplay : public IReplayDriver
|
||||
|
||||
MeshFormat GetPostVSBuffers(uint32_t frameID, uint32_t eventID, uint32_t instID, MeshDataStage stage);
|
||||
|
||||
vector<byte> GetBufferData(ResourceId buff, uint32_t offset, uint32_t len);
|
||||
vector<byte> GetBufferData(ResourceId buff, uint64_t offset, uint64_t len);
|
||||
byte *GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, bool resolve, bool forceRGBA8unorm, float blackPoint, float whitePoint, size_t &dataSize);
|
||||
|
||||
void ReplaceResource(ResourceId from, ResourceId to);
|
||||
|
||||
@@ -84,7 +84,7 @@ class IRemoteDriver
|
||||
|
||||
virtual MeshFormat GetPostVSBuffers(uint32_t frameID, uint32_t eventID, uint32_t instID, MeshDataStage stage) = 0;
|
||||
|
||||
virtual vector<byte> GetBufferData(ResourceId buff, uint32_t offset, uint32_t len) = 0;
|
||||
virtual vector<byte> GetBufferData(ResourceId buff, uint64_t offset, uint64_t len) = 0;
|
||||
virtual byte *GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t mip, bool resolve, bool forceRGBA8unorm, float blackPoint, float whitePoint, size_t &dataSize) = 0;
|
||||
|
||||
virtual void BuildTargetShader(string source, string entry, const uint32_t compileFlags, ShaderStageType type, ResourceId *id, string *errors) = 0;
|
||||
|
||||
@@ -441,7 +441,7 @@ bool ReplayRenderer::GetHistogram(ResourceId tex, uint32_t sliceFace, uint32_t m
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ReplayRenderer::GetBufferData(ResourceId buff, uint32_t offset, uint32_t len, rdctype::array<byte> *data)
|
||||
bool ReplayRenderer::GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, rdctype::array<byte> *data)
|
||||
{
|
||||
if(data == NULL) return false;
|
||||
|
||||
@@ -1286,7 +1286,7 @@ bool ReplayRenderer::DebugThread(uint32_t groupid[3], uint32_t threadid[3], Shad
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReplayRenderer::GetCBufferVariableContents(ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint32_t offs, rdctype::array<ShaderVariable> *vars)
|
||||
bool ReplayRenderer::GetCBufferVariableContents(ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint64_t offs, rdctype::array<ShaderVariable> *vars)
|
||||
{
|
||||
if(vars == NULL) return false;
|
||||
|
||||
@@ -1665,7 +1665,7 @@ extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_DebugThread(ReplayRe
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetUsage(ReplayRenderer *rend, ResourceId id, rdctype::array<EventUsage> *usage)
|
||||
{ return rend->GetUsage(id, usage); }
|
||||
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetCBufferVariableContents(ReplayRenderer *rend, ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint32_t offs, rdctype::array<ShaderVariable> *vars)
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetCBufferVariableContents(ReplayRenderer *rend, ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint64_t offs, rdctype::array<ShaderVariable> *vars)
|
||||
{ return rend->GetCBufferVariableContents(shader, cbufslot, buffer, offs, vars); }
|
||||
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_SaveTexture(ReplayRenderer *rend, const TextureSave &saveData, const char *path)
|
||||
@@ -1682,7 +1682,7 @@ extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetHistogram(ReplayR
|
||||
return rend->GetHistogram(tex, sliceFace, mip, sample, minval, maxval, chans, histogram);
|
||||
}
|
||||
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetBufferData(ReplayRenderer *rend, ResourceId buff, uint32_t offset, uint32_t len, rdctype::array<byte> *data)
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetBufferData(ReplayRenderer *rend, ResourceId buff, uint64_t offset, uint64_t len, rdctype::array<byte> *data)
|
||||
{ return rend->GetBufferData(buff, offset, len, data); }
|
||||
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetTextureData(ReplayRenderer *rend, ResourceId tex, uint32_t arrayIdx, uint32_t mip, rdctype::array<byte> *data)
|
||||
|
||||
@@ -183,12 +183,12 @@ struct ReplayRenderer : public IReplayRenderer
|
||||
|
||||
bool GetUsage(ResourceId id, rdctype::array<EventUsage> *usage);
|
||||
|
||||
bool GetBufferData(ResourceId buff, uint32_t offset, uint32_t len, rdctype::array<byte> *data);
|
||||
bool GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, rdctype::array<byte> *data);
|
||||
bool GetTextureData(ResourceId buff, uint32_t arrayIdx, uint32_t mip, rdctype::array<byte> *data);
|
||||
|
||||
bool SaveTexture(const TextureSave &saveData, const char *path);
|
||||
|
||||
bool GetCBufferVariableContents(ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint32_t offs, rdctype::array<ShaderVariable> *vars);
|
||||
bool GetCBufferVariableContents(ResourceId shader, uint32_t cbufslot, ResourceId buffer, uint64_t offs, rdctype::array<ShaderVariable> *vars);
|
||||
|
||||
ReplayOutput *CreateOutput(void *handle);
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace renderdocui.Code
|
||||
return "";
|
||||
}
|
||||
|
||||
public void GetIBuffer(out ResourceId buf, out uint ByteOffset)
|
||||
public void GetIBuffer(out ResourceId buf, out ulong ByteOffset)
|
||||
{
|
||||
if (LogLoaded)
|
||||
{
|
||||
@@ -306,8 +306,7 @@ namespace renderdocui.Code
|
||||
else if (IsLogVK)
|
||||
{
|
||||
buf = m_Vulkan.IA.ibuffer.buf;
|
||||
// VKTODOLOW maybe increase parameter to ulong and upcast others?
|
||||
ByteOffset = (uint)m_Vulkan.IA.ibuffer.offs;
|
||||
ByteOffset = m_Vulkan.IA.ibuffer.offs;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -365,7 +364,7 @@ namespace renderdocui.Code
|
||||
public struct VBuffer
|
||||
{
|
||||
public ResourceId Buffer;
|
||||
public uint ByteOffset;
|
||||
public ulong ByteOffset;
|
||||
public uint ByteStride;
|
||||
};
|
||||
|
||||
@@ -403,8 +402,7 @@ namespace renderdocui.Code
|
||||
for (int i = 0; i < m_Vulkan.VI.binds.Length; i++)
|
||||
{
|
||||
ret[i].Buffer = m_Vulkan.VI.vbuffers[i].buffer;
|
||||
// VKTODOLOW maybe increase parameter to ulong and upcast others?
|
||||
ret[i].ByteOffset = (uint)m_Vulkan.VI.vbuffers[i].offset;
|
||||
ret[i].ByteOffset = m_Vulkan.VI.vbuffers[i].offset;
|
||||
ret[i].ByteStride = m_Vulkan.VI.binds[i].bytestride;
|
||||
}
|
||||
|
||||
@@ -606,7 +604,7 @@ namespace renderdocui.Code
|
||||
return null;
|
||||
}
|
||||
|
||||
public void GetConstantBuffer(ShaderStageType stage, uint BufIdx, out ResourceId buf, out uint ByteOffset, out uint ByteSize)
|
||||
public void GetConstantBuffer(ShaderStageType stage, uint BufIdx, out ResourceId buf, out ulong ByteOffset, out ulong ByteSize)
|
||||
{
|
||||
if (LogLoaded)
|
||||
{
|
||||
@@ -627,8 +625,8 @@ namespace renderdocui.Code
|
||||
if(BufIdx < s.ConstantBuffers.Length)
|
||||
{
|
||||
buf = s.ConstantBuffers[BufIdx].Buffer;
|
||||
ByteOffset = s.ConstantBuffers[BufIdx].VecOffset * 4 * sizeof(float);
|
||||
ByteSize = s.ConstantBuffers[BufIdx].VecCount * 4 * sizeof(float);
|
||||
ByteOffset = (ulong)(s.ConstantBuffers[BufIdx].VecOffset * 4 * sizeof(float));
|
||||
ByteSize = (ulong)(s.ConstantBuffers[BufIdx].VecCount * 4 * sizeof(float));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -657,8 +655,8 @@ namespace renderdocui.Code
|
||||
var b = m_GL.UniformBuffers[uboIdx];
|
||||
|
||||
buf = b.Resource;
|
||||
ByteOffset = (uint)b.Offset;
|
||||
ByteSize = (uint)b.Size;
|
||||
ByteOffset = b.Offset;
|
||||
ByteSize = b.Size;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -687,13 +685,12 @@ namespace renderdocui.Code
|
||||
{
|
||||
var bind = s.BindpointMapping.ConstantBlocks[s.ShaderDetails.ConstantBlocks[BufIdx].bindPoint];
|
||||
|
||||
// TODO do we need to worry about arrays of uniform buffers?
|
||||
// VKTODOLOW do we need to worry about arrays of uniform buffers?
|
||||
var descriptorBind = pipe.DescSets[bind.bindset].bindings[bind.bind].binds[0];
|
||||
|
||||
buf = descriptorBind.res;
|
||||
// VKTODOLOW maybe increase parameter to ulong and upcast others?
|
||||
ByteOffset = (uint)descriptorBind.offset;
|
||||
ByteSize = (uint)descriptorBind.size;
|
||||
ByteOffset = descriptorBind.offset;
|
||||
ByteSize = descriptorBind.size;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -374,11 +374,11 @@ namespace renderdoc
|
||||
public struct MeshFormat
|
||||
{
|
||||
public ResourceId idxbuf;
|
||||
public UInt32 idxoffs;
|
||||
public UInt64 idxoffs;
|
||||
public UInt32 idxByteWidth;
|
||||
|
||||
public ResourceId buf;
|
||||
public UInt32 offset;
|
||||
public UInt64 offset;
|
||||
public UInt32 stride;
|
||||
|
||||
public UInt32 compCount;
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace renderdoc
|
||||
private static extern bool ReplayRenderer_GetUsage(IntPtr real, ResourceId id, IntPtr outusage);
|
||||
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern bool ReplayRenderer_GetCBufferVariableContents(IntPtr real, ResourceId shader, UInt32 cbufslot, ResourceId buffer, UInt32 offs, IntPtr outvars);
|
||||
private static extern bool ReplayRenderer_GetCBufferVariableContents(IntPtr real, ResourceId shader, UInt32 cbufslot, ResourceId buffer, UInt64 offs, IntPtr outvars);
|
||||
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern bool ReplayRenderer_SaveTexture(IntPtr real, TextureSave saveData, IntPtr path);
|
||||
@@ -278,7 +278,7 @@ namespace renderdoc
|
||||
private static extern bool ReplayRenderer_GetHistogram(IntPtr real, ResourceId tex, UInt32 sliceFace, UInt32 mip, UInt32 sample, float minval, float maxval, bool[] channels, IntPtr outhistogram);
|
||||
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern bool ReplayRenderer_GetBufferData(IntPtr real, ResourceId buff, UInt32 offset, UInt32 len, IntPtr outdata);
|
||||
private static extern bool ReplayRenderer_GetBufferData(IntPtr real, ResourceId buff, UInt64 offset, UInt64 len, IntPtr outdata);
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern bool ReplayRenderer_GetTextureData(IntPtr real, ResourceId tex, UInt32 arrayIdx, UInt32 mip, IntPtr outdata);
|
||||
|
||||
@@ -727,7 +727,7 @@ namespace renderdoc
|
||||
return ret;
|
||||
}
|
||||
|
||||
public ShaderVariable[] GetCBufferVariableContents(ResourceId shader, UInt32 cbufslot, ResourceId buffer, UInt32 offs)
|
||||
public ShaderVariable[] GetCBufferVariableContents(ResourceId shader, UInt32 cbufslot, ResourceId buffer, UInt64 offs)
|
||||
{
|
||||
IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));
|
||||
|
||||
@@ -815,7 +815,7 @@ namespace renderdoc
|
||||
return success;
|
||||
}
|
||||
|
||||
public byte[] GetBufferData(ResourceId buff, UInt32 offset, UInt32 len)
|
||||
public byte[] GetBufferData(ResourceId buff, UInt64 offset, UInt64 len)
|
||||
{
|
||||
IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));
|
||||
|
||||
|
||||
@@ -69,14 +69,14 @@ namespace renderdocui.Windows
|
||||
public ResourceId[] Buffers = null;
|
||||
public object[][] GenericValues = null;
|
||||
public uint[] Strides = null;
|
||||
public uint[] Offsets = null;
|
||||
public ulong[] Offsets = null;
|
||||
|
||||
public PrimitiveTopology Topology = PrimitiveTopology.Unknown;
|
||||
|
||||
public FetchDrawcall Drawcall = null;
|
||||
|
||||
public ResourceId IndexBuffer = ResourceId.Null;
|
||||
public uint IndexOffset = 0;
|
||||
public ulong IndexOffset = 0;
|
||||
public bool IndexRestart = true;
|
||||
public uint IndexRestartValue = uint.MaxValue;
|
||||
}
|
||||
@@ -695,7 +695,7 @@ namespace renderdocui.Windows
|
||||
|
||||
input.Strides = new uint[] { elems.Last().offset + elems.Last().ByteSize };
|
||||
input.Buffers = new ResourceId[] { isBuffer ? id : ResourceId.Null, isBuffer ? ResourceId.Null : id };
|
||||
input.Offsets = new uint[] { 0 };
|
||||
input.Offsets = new ulong[] { 0 };
|
||||
input.IndexBuffer = ResourceId.Null;
|
||||
input.BufferFormats = elems;
|
||||
input.IndexOffset = 0;
|
||||
@@ -735,7 +735,7 @@ namespace renderdocui.Windows
|
||||
ret.Topology = draw.topology;
|
||||
|
||||
ResourceId ibuffer = ResourceId.Null;
|
||||
uint ioffset = 0;
|
||||
ulong ioffset = 0;
|
||||
|
||||
m_Core.CurPipelineState.GetIBuffer(out ibuffer, out ioffset);
|
||||
|
||||
@@ -810,7 +810,7 @@ namespace renderdocui.Windows
|
||||
|
||||
ret.BufferFormats = f.ToArray();
|
||||
ret.Strides = new uint[] { offset };
|
||||
ret.Offsets = new uint[] { 0 };
|
||||
ret.Offsets = new ulong[] { 0 };
|
||||
ret.Buffers = null;
|
||||
|
||||
return ret;
|
||||
@@ -820,7 +820,7 @@ namespace renderdocui.Windows
|
||||
|
||||
ResourceId[] bs = new ResourceId[vbs.Length];
|
||||
uint[] s = new uint[vbs.Length];
|
||||
uint[] o = new uint[vbs.Length];
|
||||
ulong[] o = new ulong[vbs.Length];
|
||||
|
||||
for (int i = 0; i < vbs.Length; i++)
|
||||
{
|
||||
|
||||
@@ -53,8 +53,8 @@ namespace renderdocui.Controls
|
||||
shader = m_Core.CurPipelineState.GetShader(stage);
|
||||
UpdateLabels();
|
||||
|
||||
uint offs = 0;
|
||||
uint size = 0;
|
||||
ulong offs = 0;
|
||||
ulong size = 0;
|
||||
m_Core.CurPipelineState.GetConstantBuffer(Stage, Slot, out cbuffer, out offs, out size);
|
||||
|
||||
m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
|
||||
@@ -178,8 +178,8 @@ namespace renderdocui.Controls
|
||||
|
||||
public void OnEventSelected(UInt32 frameID, UInt32 eventID)
|
||||
{
|
||||
uint offs = 0;
|
||||
uint size = 0;
|
||||
ulong offs = 0;
|
||||
ulong size = 0;
|
||||
m_Core.CurPipelineState.GetConstantBuffer(Stage, Slot, out cbuffer, out offs, out size);
|
||||
|
||||
shader = m_Core.CurPipelineState.GetShader(Stage);
|
||||
|
||||
Reference in New Issue
Block a user