Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D3D11 framebuffer readback #9321

Merged
merged 3 commits into from
Feb 17, 2017
Merged

D3D11 framebuffer readback #9321

merged 3 commits into from
Feb 17, 2017

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Feb 17, 2017

D3D11: Implements support for framebuffer readback as used by a few games (like God Eater Burst), and screenshots, both normal ones and for save states.

Progress on #9317 .

@hrydgard hrydgard merged commit 741a61e into master Feb 17, 2017
@hrydgard hrydgard deleted the d3d11-readback branch February 17, 2017 23:56
D3D11_TEXTURE2D_DESC packDesc{};
packDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
packDesc.BindFlags = 0;
packDesc.Width = 512; // 512x512 is the maximum size of a framebuffer on the PSP.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is true. This is the maximum size that can be textured from, but I think drawn can be wider. See #4739. Also some games (I believe Silent Hill?) draw to one big 1024 wide surface, but draw on the left and right sides - see curRTOffsetX.

I do think 512 may be the max height. I've never seen wider than 1024, so that may be the max width.

Also, I don't know about HD remasters. Presumably they draw double the width and height or something?

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's right. Probably should just make this adaptive..

}

// Nobody calls this yet.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a branch that used this, it improved some issues in Katamari or something, but I think it was slow and had accuracy problems with some GPUs. I was thinking of using it to detect accuracy problems with GPUs on startup, although it feels painful a bit.

-[Unknown]

Copy link
Owner Author

@hrydgard hrydgard Mar 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. There are potential uses, some silly games like Burnout Dominator read the depth buffer using the CPU for lens flares, so it would be useful for that as well, though with a heavy speed hit (but we could double buffer it making lens flares one frame late).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants