mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Test entry points that could be applied to wrong resource types
This commit is contained in:
@@ -2698,12 +2698,20 @@ void D3D12Replay::GetBufferData(ResourceId buff, uint64_t offset, uint64_t lengt
|
||||
|
||||
if(it == m_pDevice->GetResourceList().end())
|
||||
{
|
||||
RDCERR("Getting buffer data for unknown buffer %s!", ToStr(buff).c_str());
|
||||
RDCERR("Getting buffer data for unknown buffer %s!",
|
||||
ToStr(m_pDevice->GetResourceManager()->GetLiveID(buff)).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
WrappedID3D12Resource1 *buffer = it->second;
|
||||
|
||||
if(buffer->GetDesc().Dimension != D3D12_RESOURCE_DIMENSION_BUFFER)
|
||||
{
|
||||
RDCERR("Getting buffer data for non-buffer %s!",
|
||||
ToStr(m_pDevice->GetResourceManager()->GetLiveID(buff)).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
RDCASSERT(buffer);
|
||||
|
||||
GetDebugManager()->GetBufferData(buffer, offset, length, retData);
|
||||
@@ -3012,7 +3020,15 @@ void D3D12Replay::GetTextureData(ResourceId tex, const Subresource &sub,
|
||||
|
||||
if(resource == NULL)
|
||||
{
|
||||
RDCERR("Trying to get texture data for unknown ID %s!", ToStr(tex).c_str());
|
||||
RDCERR("Trying to get texture data for unknown ID %s!",
|
||||
ToStr(m_pDevice->GetResourceManager()->GetLiveID(tex)).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if(resource->GetDesc().Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
|
||||
{
|
||||
RDCERR("Getting texture data for buffer %s!",
|
||||
ToStr(m_pDevice->GetResourceManager()->GetLiveID(tex)).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,3 +45,12 @@ class D3D11_Simple_Triangle(rdtest.TestCase):
|
||||
}
|
||||
|
||||
self.check_mesh_data(postvs_ref, postvs_data)
|
||||
|
||||
# Check that nothing breaks if we call typical enumeration functions on resources
|
||||
for res in self.controller.GetResources():
|
||||
res: rd.ResourceDescription
|
||||
|
||||
self.controller.GetShaderEntryPoints(res.resourceId)
|
||||
self.controller.GetUsage(res.resourceId)
|
||||
self.controller.GetBufferData(res.resourceId, 0, 0)
|
||||
self.controller.GetTextureData(res.resourceId, rd.Subresource())
|
||||
|
||||
@@ -46,3 +46,12 @@ class D3D12_Simple_Triangle(rdtest.TestCase):
|
||||
|
||||
self.check_mesh_data(postvs_ref, postvs_data)
|
||||
|
||||
# Check that nothing breaks if we call typical enumeration functions on resources
|
||||
for res in self.controller.GetResources():
|
||||
res: rd.ResourceDescription
|
||||
|
||||
self.controller.GetShaderEntryPoints(res.resourceId)
|
||||
self.controller.GetUsage(res.resourceId)
|
||||
self.controller.GetBufferData(res.resourceId, 0, 0)
|
||||
self.controller.GetTextureData(res.resourceId, rd.Subresource())
|
||||
|
||||
|
||||
@@ -48,3 +48,12 @@ class GL_Simple_Triangle(rdtest.TestCase):
|
||||
}
|
||||
|
||||
self.check_mesh_data(postvs_ref, postvs_data)
|
||||
|
||||
# Check that nothing breaks if we call typical enumeration functions on resources
|
||||
for res in self.controller.GetResources():
|
||||
res: rd.ResourceDescription
|
||||
|
||||
self.controller.GetShaderEntryPoints(res.resourceId)
|
||||
self.controller.GetUsage(res.resourceId)
|
||||
self.controller.GetBufferData(res.resourceId, 0, 0)
|
||||
self.controller.GetTextureData(res.resourceId, rd.Subresource())
|
||||
|
||||
@@ -48,3 +48,12 @@ class VK_Simple_Triangle(rdtest.TestCase):
|
||||
}
|
||||
|
||||
self.check_mesh_data(postvs_ref, postvs_data)
|
||||
|
||||
# Check that nothing breaks if we call typical enumeration functions on resources
|
||||
for res in self.controller.GetResources():
|
||||
res: rd.ResourceDescription
|
||||
|
||||
self.controller.GetShaderEntryPoints(res.resourceId)
|
||||
self.controller.GetUsage(res.resourceId)
|
||||
self.controller.GetBufferData(res.resourceId, 0, 0)
|
||||
self.controller.GetTextureData(res.resourceId, rd.Subresource())
|
||||
|
||||
Reference in New Issue
Block a user