Test entry points that could be applied to wrong resource types

This commit is contained in:
baldurk
2020-10-02 16:43:11 +01:00
parent 1b35c93999
commit 4518fda3ed
5 changed files with 54 additions and 2 deletions
+18 -2
View File
@@ -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())
+9
View File
@@ -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())