mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
D3D11: Always use accurate depth.
The Direct3D APIs use a "min" and "max" value, and it's required that min must be less than or equal to max. If this requirement is not met, the viewport parameters are not updated. We forced accurate depth on for NVIDIA and AMD, but this just meant Intel was still broken and less people were reporting bugs about it. Although the PSP GE has depth viewport transform, this is not used for clipping and is not actually the depth range. The minz and maxz GE registers are the depth range, and minz must be less than or equal to maxz for drawing to occur.
This commit is contained in:
parent
4c5ed9f6aa
commit
4ea5d165f5
2 changed files with 9 additions and 11 deletions
|
@ -132,12 +132,10 @@ void GPU_D3D11::CheckGPUFeatures() {
|
|||
features |= GPU_SUPPORTS_BLEND_MINMAX;
|
||||
features |= GPU_PREFER_CPU_DOWNLOAD;
|
||||
|
||||
// Accurate depth is required on AMD/nVidia (for reverse Z) so we ignore the compat flag to disable it on those. See #9545
|
||||
auto vendor = draw_->GetDeviceCaps().vendor;
|
||||
|
||||
if (!PSP_CoreParameter().compat.flags().DisableAccurateDepth || vendor == Draw::GPUVendor::VENDOR_AMD || vendor == Draw::GPUVendor::VENDOR_NVIDIA) {
|
||||
features |= GPU_SUPPORTS_ACCURATE_DEPTH; // Breaks text in PaRappa for some reason.
|
||||
}
|
||||
// Accurate depth is required because the Direct3D API does not support inverse Z.
|
||||
// So we cannot incorrectly use the viewport transform as the depth range on Direct3D.
|
||||
// TODO: Breaks text in PaRappa for some reason?
|
||||
features |= GPU_SUPPORTS_ACCURATE_DEPTH;
|
||||
|
||||
#ifndef _M_ARM
|
||||
// TODO: Do proper feature detection
|
||||
|
|
|
@ -167,12 +167,12 @@ void GPU_DX9::CheckGPUFeatures() {
|
|||
features |= GPU_SUPPORTS_TEXTURE_LOD_CONTROL;
|
||||
features |= GPU_PREFER_CPU_DOWNLOAD;
|
||||
|
||||
auto vendor = draw_->GetDeviceCaps().vendor;
|
||||
// Accurate depth is required on AMD/nVidia (for reverse Z) so we ignore the compat flag to disable it on those. See #9545
|
||||
if (!PSP_CoreParameter().compat.flags().DisableAccurateDepth || vendor == Draw::GPUVendor::VENDOR_AMD || vendor == Draw::GPUVendor::VENDOR_NVIDIA) {
|
||||
features |= GPU_SUPPORTS_ACCURATE_DEPTH;
|
||||
}
|
||||
// Accurate depth is required because the Direct3D API does not support inverse Z.
|
||||
// So we cannot incorrectly use the viewport transform as the depth range on Direct3D.
|
||||
// TODO: Breaks text in PaRappa for some reason?
|
||||
features |= GPU_SUPPORTS_ACCURATE_DEPTH;
|
||||
|
||||
auto vendor = draw_->GetDeviceCaps().vendor;
|
||||
if (!PSP_CoreParameter().compat.flags().DepthRangeHack) {
|
||||
// VS range culling (killing triangles in the vertex shader using NaN) causes problems on Intel.
|
||||
// Also causes problems on old NVIDIA.
|
||||
|
|
Loading…
Add table
Reference in a new issue