GL: Added num mips to sampler state cache hash value.

This commit is contained in:
bkaradzic 2013-12-16 21:34:33 -08:00
parent 2fdea069ac
commit f4260eb405
2 changed files with 3 additions and 1 deletions

View file

@ -190,7 +190,8 @@
#define BGFX_TEXTURE_MIP_POINT UINT32_C(0x00100000) #define BGFX_TEXTURE_MIP_POINT UINT32_C(0x00100000)
#define BGFX_TEXTURE_MIP_SHIFT 20 #define BGFX_TEXTURE_MIP_SHIFT 20
#define BGFX_TEXTURE_MIP_MASK UINT32_C(0x00100000) #define BGFX_TEXTURE_MIP_MASK UINT32_C(0x00100000)
#define BGFX_TEXTURE_RESERVED_MASK UINT32_C(0xf0000000) #define BGFX_TEXTURE_RESERVED_SHIFT 24
#define BGFX_TEXTURE_RESERVED_MASK UINT32_C(0xff000000)
/// ///
#define BGFX_RENDER_TARGET_NONE UINT32_C(0x00000000) #define BGFX_RENDER_TARGET_NONE UINT32_C(0x00000000)

View file

@ -708,6 +708,7 @@ namespace bgfx
#else #else
if (0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) ) if (0 == (BGFX_SAMPLER_DEFAULT_FLAGS & _flags) )
{ {
_flags = (_flags&(~BGFX_TEXTURE_RESERVED_MASK) ) | (_numMips<<BGFX_TEXTURE_RESERVED_SHIFT);
GLuint sampler = m_samplerStateCache.find(_flags); GLuint sampler = m_samplerStateCache.find(_flags);
if (UINT32_MAX == sampler) if (UINT32_MAX == sampler)