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

D3D: Use a 32-bit floating point depth buffer. #3495

Merged
merged 2 commits into from Jan 13, 2016

Conversation

CrossVR
Copy link
Contributor

@CrossVR CrossVR commented Jan 11, 2016

This was previously reverted because of a regression on the DefJam FIFO in PR #2415, due to recent changes this seems to no longer be the case.

The advantage of using a 32-bit depth buffer is that it fixes round-trip errors as shown by the z poke hw test. Together with the commit that fixes the depth range for Z pokes, D3D has no more roundtrip errors.

@Helios747
Copy link
Contributor

This is some pretty deep stuff.

@CrossVR
Copy link
Contributor Author

CrossVR commented Jan 11, 2016

@aserna3 1 minute and 10 seconds, that's some quick punning.

hr = D3D::device->CreateTexture2D(&texdesc, nullptr, &buf);
CHECK(hr==S_OK, "create EFB depth texture (size: %dx%d; hr=%#x)", m_target_width, m_target_height, hr);
m_efb.depth_tex = new D3DTexture2D(buf, (D3D11_BIND_FLAG)(D3D11_BIND_DEPTH_STENCIL|D3D11_BIND_SHADER_RESOURCE), DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN, (sample_desc.Count > 1));
m_efb.depth_tex = new D3DTexture2D(buf, (D3D11_BIND_FLAG)(D3D11_BIND_DEPTH_STENCIL|D3D11_BIND_SHADER_RESOURCE), DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, DXGI_FORMAT_D32_FLOAT_S8X24_UINT, DXGI_FORMAT_UNKNOWN, (sample_desc.Count > 1));

This comment was marked as off-topic.

This comment was marked as off-topic.

@CrossVR CrossVR added bug WIP / do not merge Work in progress (do not merge) labels Jan 11, 2016
@@ -127,10 +127,10 @@ FramebufferManager::FramebufferManager()
D3D::SetDebugObjectName((ID3D11DeviceChild*)m_efb.color_staging_buf, "EFB color staging texture (used for Renderer::AccessEFB)");

// EFB depth buffer - primary depth buffer
texdesc = CD3D11_TEXTURE2D_DESC(DXGI_FORMAT_R24G8_TYPELESS, m_target_width, m_target_height, m_efb.slices, 1, D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE, D3D11_USAGE_DEFAULT, 0, sample_desc.Count, sample_desc.Quality);
texdesc = CD3D11_TEXTURE2D_DESC(DXGI_FORMAT_R32G8X24_TYPELESS, m_target_width, m_target_height, m_efb.slices, 1, D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE, D3D11_USAGE_DEFAULT, 0, sample_desc.Count, sample_desc.Quality);

This comment was marked as off-topic.

@degasus
Copy link
Member

degasus commented Jan 11, 2016

@CrossVR
Copy link
Contributor Author

CrossVR commented Jan 11, 2016

@degasus But it's clamped for that reason right?

@degasus
Copy link
Member

degasus commented Jan 11, 2016

on efb access, it's clamped after the u32 cast, and I don't see the clamp in the efb copy code.

@CrossVR CrossVR removed bug WIP / do not merge Work in progress (do not merge) labels Jan 12, 2016
@CrossVR CrossVR added this to the Dolphin Release 5.0 milestone Jan 12, 2016
@CrossVR
Copy link
Contributor Author

CrossVR commented Jan 13, 2016

@dolphin-emu-bot rebuild

@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • chibi-robo-zfighting on dx-win-nv: diff
  • custom-brawl-char on dx-win-nv: diff
  • DKCR-Char on dx-win-nv: diff
  • ed-lighting on dx-win-nv: diff
  • fortune-street on dx-win-nv: diff
  • kirby-shadows on dx-win-nv: diff
  • luigi-shadows on dx-win-nv: diff
  • mario-sluggers-bar on dx-win-nv: diff
  • medabots-crash on dx-win-nv: diff
  • melee-depth on dx-win-nv: diff
  • melee-lighting on dx-win-nv: diff
  • mii-channel on dx-win-nv: diff
  • milotic-texture on dx-win-nv: diff
  • mini-ninjas on dx-win-nv: diff
  • mkdd-efb on dx-win-nv: diff
  • mkwii-bluebox on dx-win-nv: diff
  • monkeyball-fuse on dx-win-nv: diff
  • mp3-bloom on dx-win-nv: diff
  • mtennis-zfreeze on dx-win-nv: diff
  • my-word-coach on dx-win-nv: diff
  • nddemo-bumpmapping on dx-win-nv: diff
  • nfsu-reflections on dx-win-nv: diff
  • pm-hc-jp on dx-win-nv: diff
  • rs2-glass on dx-win-nv: diff
  • rs2-skybox on dx-win-nv: diff
  • rs2-zfreeze on dx-win-nv: diff
  • sadx-ui on dx-win-nv: diff
  • sf-assault-flashing on dx-win-nv: diff
  • smg2-fog on dx-win-nv: diff
  • sms-bubbles on dx-win-nv: diff
  • sms-gc on dx-win-nv: diff
  • soa-black on dx-win-nv: diff
  • soniccolors-mm on dx-win-nv: diff
  • sonicriderszg-gb on dx-win-nv: diff
  • spyro-bloom on dx-win-nv: diff
  • ssbm-pointsize on dx-win-nv: diff
  • ss-map on dx-win-nv: diff
  • thps3-earlyz on dx-win-nv: diff
  • thps4-shadow on dx-win-nv: diff
  • tos-invis-char on dx-win-nv: diff
  • vegas-party-depth on dx-win-nv: diff
  • xenoblade-menu on dx-win-nv: diff
  • ztp-grass on dx-win-nv: diff
  • zww-armos on dx-win-nv: diff
  • zww-water on dx-win-nv: diff
  • zww-waves on dx-win-nv: diff

automated-fifoci-reporter

@degasus
Copy link
Member

degasus commented Jan 13, 2016

Sounds fine to me.

CrossVR added a commit that referenced this pull request Jan 13, 2016
D3D: Use a 32-bit floating point depth buffer.
@CrossVR CrossVR merged commit 48b6064 into dolphin-emu:master Jan 13, 2016
@CrossVR CrossVR deleted the d3d-float branch January 13, 2016 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants