]> git.cworth.org Git - apitrace/blobdiff - retrace/d3d11state_images.cpp
d3dretrace: Dump UINT formats too.
[apitrace] / retrace / d3d11state_images.cpp
index 60efc7d4e9ea1f63136c6b69031b31f4ba3743e7..08f745dddc87cb3f1c99ba073f0da212121ff532 100644 (file)
@@ -29,7 +29,8 @@
 #include <iostream>
 #include <algorithm>
 
-#include "image.hpp"
+#include "os.hpp"
+#include "json.hpp"
 #include "d3d11imports.hpp"
 #include "d3d10state.hpp"
 #include "dxgistate.hpp"
@@ -211,25 +212,11 @@ getRenderTargetViewImage(ID3D11DeviceContext *pDevice,
         goto no_map;
     }
 
-    image = new image::Image(Width, Height, 4);
-    if (!image) {
-        goto no_image;
-    }
-    assert(image->stride() > 0);
-
-    hr = ConvertFormat(Desc.Format,
-                       MappedSubresource.pData,
-                       MappedSubresource.RowPitch,
-                       DXGI_FORMAT_R8G8B8A8_UNORM,
-                       image->start(),
-                       image->stride(),
-                       Width, Height);
-    if (FAILED(hr)) {
-        delete image;
-        image = NULL;
-    }
+    image = ConvertImage(Desc.Format,
+                         MappedSubresource.pData,
+                         MappedSubresource.RowPitch,
+                         Width, Height);
 
-no_image:
     pDevice->Unmap(pStagingResource, Subresource);
 no_map:
     if (pStagingResource) {