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

TextureCache: Add the ability to deduce if two textures are depth on blit. #2917

Merged
merged 2 commits into from Oct 5, 2019

Conversation

@FernandoS27
Copy link
Contributor

commented Sep 28, 2019

This PR adds another HLE mechanism to the texture cache. It turns out that Fermi2D blits depth formats as color formats, forcing us to do an expensive depth -> color conversion through buffer copies. With this PR, the texture cache will try to deduce if the textures are both depth (or 1 is depth & the other is not known) and will try to correct the formatting, in order to avoid expensive copies.

This work great on ZLA and DKCTF.

@MysticExile MysticExile added the gpu-new label Sep 28, 2019
/**
* `DeduceSurface` gets the starting address and parameters of a candidate surface and tries
* to find a matching surface within the cache that's similar to it. If there are many textures
* or the texture found if entirely imcompatible, it will fail. If no texture is found, the

This comment has been minimized.

Copy link
@MysticExile

MysticExile Sep 28, 2019

Contributor
Suggested change
* or the texture found if entirely imcompatible, it will fail. If no texture is found, the
* or the texture found if entirely incompatible, it will fail. If no texture is found, the

/**
* `DeduceBestBlit` gets the a source and destination starting address and parameters,
* and tries to deduce if they are suppose to be depth textures. If so, their

This comment has been minimized.

Copy link
@MysticExile

MysticExile Sep 28, 2019

Contributor
Suggested change
* and tries to deduce if they are suppose to be depth textures. If so, their
* and tries to deduce if they are supposed to be depth textures. If so, their
* and tries to deduce if they are suppose to be depth textures. If so, their
* parameters are modified and fixed into so.
* @param gpu_addr, the starting address of the candidate surface.
* @param params, the paremeters on the candidate surface.

This comment has been minimized.

Copy link
@MysticExile

MysticExile Sep 28, 2019

Contributor
Suggested change
* @param params, the paremeters on the candidate surface.
* @param params, the parameters on the candidate surface.
to.component_type = params.component_type;
to.type = params.type;
});
// Now we got the cases where one or both is Depth and the other is not known)

This comment has been minimized.

Copy link
@MysticExile

MysticExile Sep 28, 2019

Contributor
Suggested change
// Now we got the cases where one or both is Depth and the other is not known)
// Now we got the cases where one or both is Depth and the other is not known

Typo

Copy link
Contributor

left a comment

minor spelling and grammar

return;
}

const bool imcomplete_src = deduc_src.Imcomplete();

This comment has been minimized.

Copy link
@MysticExile

MysticExile Sep 28, 2019

Contributor
Suggested change
const bool imcomplete_src = deduc_src.Imcomplete();
const bool imcomplete_src = deduc_src.Incomplete();
}

const bool imcomplete_src = deduc_src.Imcomplete();
const bool imcomplete_dst = deduc_dst.Imcomplete();

This comment has been minimized.

Copy link
@MysticExile

MysticExile Sep 28, 2019

Contributor
Suggested change
const bool imcomplete_dst = deduc_dst.Imcomplete();
const bool imcomplete_dst = deduc_dst.Incomplete();

ditto

@FernandoS27 FernandoS27 force-pushed the FernandoS27:fermi-deduction-2 branch from a461b87 to 278d653 Sep 28, 2019
Copy link
Contributor

left a comment

Just one nit

**/
void DeduceBestBlit(SurfaceParams& src_params, SurfaceParams& dst_params,
const GPUVAddr src_gpu_addr, const GPUVAddr dst_gpu_addr) {
auto deduc_src = DeduceSurface(src_gpu_addr, src_params);

This comment has been minimized.

Copy link
@ReinUsesLisp

ReinUsesLisp Sep 28, 2019

Contributor

deduced

@CLAassistant

This comment has been minimized.

Copy link

commented Sep 30, 2019

CLA assistant check
All committers have signed the CLA.

@FernandoS27 FernandoS27 force-pushed the FernandoS27:fermi-deduction-2 branch from 278d653 to ab47a66 Oct 4, 2019
@bunnei bunnei merged commit 0a662d0 into yuzu-emu:master Oct 5, 2019
6 checks passed
6 checks passed
license/cla Contributor License Agreement is signed.
Details
yuzu verify Build #20191004.9 succeeded
Details
yuzu verify (build standard linux) build standard linux succeeded
Details
yuzu verify (build standard windows) build standard windows succeeded
Details
yuzu verify (build testing windows) build testing windows succeeded
Details
yuzu verify (format clang) format clang succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.