ソースを参照

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

bkaradzic 12 年 前
コミット
f4260eb405
2 ファイル変更3 行追加1 行削除
  1. 2 1
      include/bgfx.h
  2. 1 0
      src/renderer_gl.cpp

+ 2 - 1
include/bgfx.h

@@ -190,7 +190,8 @@
 #define BGFX_TEXTURE_MIP_POINT           UINT32_C(0x00100000)
 #define BGFX_TEXTURE_MIP_SHIFT           20
 #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)

+ 1 - 0
src/renderer_gl.cpp

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