From be8c9576f57b9d1401e5957e7ed991fdc570740b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 20 Jan 2015 22:07:30 -0800 Subject: [PATCH] Fixed issue #225. --- src/renderer_d3d11.cpp | 8 ++++---- src/renderer_d3d9.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 82a2bafa..6d4c2920 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -160,17 +160,17 @@ namespace bgfx { 0x10, // min linear 0x00, // min point - 0x55, // anisotopic + 0x55, // anisotropic }, { 0x04, // mag linear 0x00, // mag point - 0x55, // anisotopic + 0x55, // anisotropic }, { 0x01, // mip linear 0x00, // mip point - 0x55, // anisotopic + 0x55, // anisotropic }, }; @@ -1714,7 +1714,7 @@ namespace bgfx sd.AddressV = s_textureAddress[(_flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT]; sd.AddressW = s_textureAddress[(_flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT]; sd.MipLODBias = 0.0f; - sd.MaxAnisotropy = 1; + sd.MaxAnisotropy = D3D11_REQ_MAXANISOTROPY; sd.ComparisonFunc = 0 == cmpFunc ? D3D11_COMPARISON_NEVER : s_cmpFunc[cmpFunc]; sd.BorderColor[0] = 0.0f; sd.BorderColor[1] = 0.0f; diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index 669f2dee..23b2dea9 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -459,6 +459,8 @@ namespace bgfx m_caps.NumSimultaneousRTs = bx::uint32_min(m_caps.NumSimultaneousRTs, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS); g_caps.maxFBAttachments = (uint8_t)m_caps.NumSimultaneousRTs; + m_caps.MaxAnisotropy = bx::uint32_min(m_caps.MaxAnisotropy, 1); + if (BX_ENABLED(BGFX_CONFIG_RENDERER_USE_EXTENSIONS) ) { BX_TRACE("Extended formats:"); @@ -1241,12 +1243,13 @@ namespace bgfx D3DTEXTUREFILTERTYPE minFilter = s_textureFilter[(_flags&BGFX_TEXTURE_MIN_MASK)>>BGFX_TEXTURE_MIN_SHIFT]; D3DTEXTUREFILTERTYPE magFilter = s_textureFilter[(_flags&BGFX_TEXTURE_MAG_MASK)>>BGFX_TEXTURE_MAG_SHIFT]; D3DTEXTUREFILTERTYPE mipFilter = s_textureFilter[(_flags&BGFX_TEXTURE_MIP_MASK)>>BGFX_TEXTURE_MIP_SHIFT]; - DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_ADDRESSU, tau) ); - DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_ADDRESSV, tav) ); + DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_ADDRESSU, tau) ); + DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_ADDRESSV, tav) ); + DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_ADDRESSW, taw) ); DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_MINFILTER, minFilter) ); DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_MAGFILTER, magFilter) ); DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_MIPFILTER, mipFilter) ); - DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_ADDRESSW, taw) ); + DX_CHECK(device->SetSamplerState(_stage, D3DSAMP_MAXANISOTROPY, m_caps.MaxAnisotropy) ); } }