summaryrefslogtreecommitdiff
path: root/retrace/d3d9state_images.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'retrace/d3d9state_images.cpp')
-rw-r--r--retrace/d3d9state_images.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/retrace/d3d9state_images.cpp b/retrace/d3d9state_images.cpp
index 6ceb5149..f26aa662 100644
--- a/retrace/d3d9state_images.cpp
+++ b/retrace/d3d9state_images.cpp
@@ -53,6 +53,11 @@ getSurfaceImage(IDirect3DDevice9 *pDevice,
hr = pSurface->GetDesc(&Desc);
assert(SUCCEEDED(hr));
+ if (Desc.Format == D3DFMT_NULL) {
+ // dummy rendertarget
+ return NULL;
+ }
+
D3DLOCKED_RECT LockedRect;
hr = pSurface->LockRect(&LockedRect, NULL, D3DLOCK_READONLY);
if (FAILED(hr)) {
@@ -83,6 +88,11 @@ getRenderTargetImage(IDirect3DDevice9 *pDevice,
hr = pRenderTarget->GetDesc(&Desc);
assert(SUCCEEDED(hr));
+ if (Desc.Format == D3DFMT_NULL) {
+ // dummy rendertarget
+ return NULL;
+ }
+
com_ptr<IDirect3DSurface9> pStagingSurface;
hr = pDevice->CreateOffscreenPlainSurface(Desc.Width, Desc.Height, Desc.Format, D3DPOOL_SYSTEMMEM, &pStagingSurface, NULL);
if (FAILED(hr)) {