This commit is contained in:
Branimir Karadžić 2015-12-13 12:33:27 -08:00
parent 06e1486132
commit 51ec498559
3 changed files with 7 additions and 7 deletions

View file

@ -260,6 +260,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|| setOrToggle(s_reset, "flush", BGFX_RESET_FLUSH_AFTER_RENDER, 1, _argc, _argv) || setOrToggle(s_reset, "flush", BGFX_RESET_FLUSH_AFTER_RENDER, 1, _argc, _argv)
|| setOrToggle(s_reset, "flip", BGFX_RESET_FLIP_AFTER_RENDER, 1, _argc, _argv) || setOrToggle(s_reset, "flip", BGFX_RESET_FLIP_AFTER_RENDER, 1, _argc, _argv)
|| setOrToggle(s_reset, "hidpi", BGFX_RESET_HIDPI, 1, _argc, _argv) || setOrToggle(s_reset, "hidpi", BGFX_RESET_HIDPI, 1, _argc, _argv)
|| setOrToggle(s_reset, "depthclamp", BGFX_RESET_DEPTH_CLAMP, 1, _argc, _argv)
) )
{ {
return 0; return 0;

View file

@ -2182,11 +2182,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
m_samplerStateCache.invalidate(); m_samplerStateCache.invalidate();
} }
bool depthClamp = false; bool depthClamp = true
if (!!(_resolution.m_flags & BGFX_RESET_DEPTH_CLAMP) ) && !!(_resolution.m_flags & BGFX_RESET_DEPTH_CLAMP)
{ && m_featureLevel > D3D_FEATURE_LEVEL_9_3 // disabling depth clamp is only supported on 10_0+
depthClamp = m_featureLevel <= D3D_FEATURE_LEVEL_9_3; // disabling depth clamp is only supported on 10_0+ ;
}
if (m_depthClamp != depthClamp) if (m_depthClamp != depthClamp)
{ {
@ -2673,7 +2672,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
desc.DepthBias = 0; desc.DepthBias = 0;
desc.DepthBiasClamp = 0.0f; desc.DepthBiasClamp = 0.0f;
desc.SlopeScaledDepthBias = 0.0f; desc.SlopeScaledDepthBias = 0.0f;
desc.DepthClipEnable = m_depthClamp; desc.DepthClipEnable = !m_depthClamp;
desc.ScissorEnable = _scissor; desc.ScissorEnable = _scissor;
desc.MultisampleEnable = !!(_state&BGFX_STATE_MSAA); desc.MultisampleEnable = !!(_state&BGFX_STATE_MSAA);
desc.AntialiasedLineEnable = false; desc.AntialiasedLineEnable = false;

View file

@ -2016,7 +2016,7 @@ data.NumQualityLevels = 0;
desc.DepthBias = 0; desc.DepthBias = 0;
desc.DepthBiasClamp = 0.0f; desc.DepthBiasClamp = 0.0f;
desc.SlopeScaledDepthBias = 0.0f; desc.SlopeScaledDepthBias = 0.0f;
desc.DepthClipEnable = m_depthClamp; desc.DepthClipEnable = !m_depthClamp;
desc.MultisampleEnable = !!(_state&BGFX_STATE_MSAA); desc.MultisampleEnable = !!(_state&BGFX_STATE_MSAA);
desc.AntialiasedLineEnable = false; desc.AntialiasedLineEnable = false;
desc.ForcedSampleCount = 0; desc.ForcedSampleCount = 0;