diff --git a/examples/01-cubes/cubes.cpp b/examples/01-cubes/cubes.cpp index 2376e52cc..3b679eae1 100644 --- a/examples/01-cubes/cubes.cpp +++ b/examples/01-cubes/cubes.cpp @@ -175,7 +175,7 @@ class ExampleCubes : public entry::AppI bx::mtxLookAt(view, eye, at); float proj[16]; - bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f); + bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f, bgfx::getCaps()->homogeneousDepth); bgfx::setViewTransform(0, view, proj); // Set view 0 default viewport. diff --git a/examples/02-metaballs/metaballs.cpp b/examples/02-metaballs/metaballs.cpp index 10ca1cc83..60728cc67 100644 --- a/examples/02-metaballs/metaballs.cpp +++ b/examples/02-metaballs/metaballs.cpp @@ -576,7 +576,7 @@ class ExampleMetaballs : public entry::AppI bx::mtxLookAt(view, eye, at); float proj[16]; - bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f); + bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f, bgfx::getCaps()->homogeneousDepth); bgfx::setViewTransform(0, view, proj); // Set view 0 default viewport. diff --git a/examples/04-mesh/mesh.cpp b/examples/04-mesh/mesh.cpp index 57147acf8..e23438c67 100644 --- a/examples/04-mesh/mesh.cpp +++ b/examples/04-mesh/mesh.cpp @@ -105,7 +105,7 @@ class ExampleMesh : public entry::AppI bx::mtxLookAt(view, eye, at); float proj[16]; - bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f); + bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f, bgfx::getCaps()->homogeneousDepth); bgfx::setViewTransform(0, view, proj); // Set view 0 default viewport. diff --git a/examples/05-instancing/instancing.cpp b/examples/05-instancing/instancing.cpp index b06f28894..834969ea0 100644 --- a/examples/05-instancing/instancing.cpp +++ b/examples/05-instancing/instancing.cpp @@ -174,7 +174,7 @@ class ExampleInstancing : public entry::AppI bx::mtxLookAt(view, eye, at); float proj[16]; - bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f); + bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f, bgfx::getCaps()->homogeneousDepth); bgfx::setViewTransform(0, view, proj); // Set view 0 default viewport. diff --git a/examples/06-bump/bump.cpp b/examples/06-bump/bump.cpp index 89ec40112..101bf8fc9 100644 --- a/examples/06-bump/bump.cpp +++ b/examples/06-bump/bump.cpp @@ -239,7 +239,7 @@ class ExampleBump : public entry::AppI bx::mtxLookAt(view, eye, at); float proj[16]; - bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 100.0f); + bx::mtxProj(proj, 60.0f, float(m_width) / float(m_height), 0.1f, 100.0f, bgfx::getCaps()->homogeneousDepth); bgfx::setViewTransform(0, view, proj); // Set view 0 default viewport. diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 037fefa57..0248023c6 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -369,15 +369,6 @@ namespace bgfx return un.ui; } - inline float fixupDepthClear(float _depth) - { - // BK - makes consitent depth clear value between GL and DX (and other APIs). - return g_caps.homogeneousDepth - ? _depth*0.5f + 0.5f - : _depth - ; - } - inline uint64_t packStencil(uint32_t _fstencil, uint32_t _bstencil) { return (uint64_t(_bstencil)<<32)|uint64_t(_fstencil); @@ -3692,7 +3683,7 @@ namespace bgfx clear.m_index[1] = uint8_t(_rgba>>16); clear.m_index[2] = uint8_t(_rgba>> 8); clear.m_index[3] = uint8_t(_rgba>> 0); - clear.m_depth = fixupDepthClear(_depth); + clear.m_depth = _depth; clear.m_stencil = _stencil; } @@ -3715,7 +3706,7 @@ namespace bgfx clear.m_index[5] = _5; clear.m_index[6] = _6; clear.m_index[7] = _7; - clear.m_depth = fixupDepthClear(_depth); + clear.m_depth = _depth; clear.m_stencil = _stencil; }