static int getFromRenderTarget11(struct avientry *avie, bool renderTarget)
{
int ok = 0;
- int w, h, pitch, bits = 32;
+ int w, h, pitch, bits = 32, d;
void *data;
- bool got = D3D11_capture(aviout_monid, &data, &w, &h, &pitch, renderTarget);
+ bool got = D3D11_capture(aviout_monid, &data, &w, &h, &d, &pitch, renderTarget);
if (got) {
int dpitch = ((aviout_width_out * avioutput_bits + 31) & ~31) / 8;
for (int y = 0; y < h && y < aviout_height_out; y++) {
}
}
}
- D3D11_capture(aviout_monid, NULL, NULL, NULL, NULL, renderTarget);
+ D3D11_capture(aviout_monid, NULL, NULL, NULL, NULL, NULL, renderTarget);
ok = 1;
}
return ok;
extern void(*D3D_paint)(void);
extern LPDIRECT3DSURFACE9 D3D_capture(int, int*,int*,int*,bool);
-extern bool D3D11_capture(int, void**,int*, int*,int*,bool);
+extern bool D3D11_capture(int, void**,int*, int*, int*,int*,bool);
void D3D_getpixelformat(int depth, int *rb, int *gb, int *bb, int *rs, int *gs, int *bs, int *ab, int *as, int *a);
}
}
-bool D3D11_capture(int monid, void **data, int *w, int *h, int *pitch, bool rendertarget)
+bool D3D11_capture(int monid, void **data, int *w, int *h, int *d, int *pitch, bool rendertarget)
{
struct d3d11struct *d3d = &d3d11data[monid];
HRESULT hr;
*pitch = map.RowPitch;
*w = desc.Width;
*h = desc.Height;
+ *d = d3d->hdr ? 36 : 24;
return true;
} else {
write_log(_T("Screenshot RenderTargetView->GetResource() failed\n"));
height = state->Height;
}
if (D3D_isenabled(0) == 2) {
- int w, h, pitch, bits = 32;
+ int w, h, pitch, bits = 32, d;
void *data;
- bool got = D3D11_capture(monid, &data, &w, &h, &pitch, renderTarget);
+ bool got = D3D11_capture(monid, &data, &w, &h, &d, &pitch, renderTarget);
int dpitch = (((width * depth + 31) & ~31) / 8);
lpvBits = xmalloc(uae_u8, dpitch * height);
bi->bmiHeader.biClrUsed = 0;
bi->bmiHeader.biClrImportant = 0;
- if (got && lpvBits) {
+ if (got && lpvBits && d <= 32) {
for (int y = 0; y < h && y < height; y++) {
uae_u8 *d = (uae_u8*)lpvBits + (height - y - 1) * dpitch;
uae_u32 *s = (uae_u32*)((uae_u8*)data + y * pitch);
}
}
if (got)
- D3D11_capture(monid, NULL, NULL, NULL, NULL, renderTarget);
+ D3D11_capture(monid, NULL, NULL, NULL, NULL, NULL, renderTarget);
d3dcaptured = true;
} else if (D3D_isenabled(0) == 1) {