mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Check the most likely resources first (buffer -> tex2d -> 3d -> 1d)
* This is a slight win by avoiding checking all the shader pools
This commit is contained in:
@@ -303,6 +303,15 @@ ResourceId GetIDForResource(ID3D11DeviceChild *ptr)
|
||||
if(ptr == NULL)
|
||||
return ResourceId();
|
||||
|
||||
if(WrappedID3D11Buffer::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Buffer *)ptr)->GetResourceID();
|
||||
if(WrappedID3D11Texture2D1::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Texture2D1 *)ptr)->GetResourceID();
|
||||
if(WrappedID3D11Texture3D1::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Texture3D1 *)ptr)->GetResourceID();
|
||||
if(WrappedID3D11Texture1D::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Texture1D *)ptr)->GetResourceID();
|
||||
|
||||
if(WrappedID3D11InputLayout::IsAlloc(ptr))
|
||||
return ((WrappedID3D11InputLayout *)ptr)->GetResourceID();
|
||||
|
||||
@@ -319,16 +328,6 @@ ResourceId GetIDForResource(ID3D11DeviceChild *ptr)
|
||||
if(WrappedID3D11Shader<ID3D11ComputeShader>::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Shader<ID3D11ComputeShader> *)ptr)->GetResourceID();
|
||||
|
||||
if(WrappedID3D11Buffer::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Buffer *)ptr)->GetResourceID();
|
||||
|
||||
if(WrappedID3D11Texture1D::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Texture1D *)ptr)->GetResourceID();
|
||||
if(WrappedID3D11Texture2D1::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Texture2D1 *)ptr)->GetResourceID();
|
||||
if(WrappedID3D11Texture3D1::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Texture3D1 *)ptr)->GetResourceID();
|
||||
|
||||
if(WrappedID3D11RasterizerState2::IsAlloc(ptr))
|
||||
return ((WrappedID3D11RasterizerState2 *)ptr)->GetResourceID();
|
||||
if(WrappedID3D11BlendState1::IsAlloc(ptr))
|
||||
|
||||
Reference in New Issue
Block a user