diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 11ff4f9f..5c94d3b2 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -138,8 +138,6 @@ namespace stl #define BGFX_STATE_TEX_COUNT 8 #define BGFX_SAMPLER_DEFAULT_FLAGS UINT32_C(0x10000000) -#define BGFX_SAMPLER_TEXTURE UINT32_C(0x00000000) -#define BGFX_SAMPLER_TYPE_MASK UINT32_C(0xc0000000) #if BGFX_CONFIG_RENDERER_DIRECT3D9 # define BGFX_RENDERER_NAME "Direct3D 9" @@ -945,7 +943,7 @@ namespace bgfx for (uint32_t ii = 0; ii < BGFX_STATE_TEX_COUNT; ++ii) { m_sampler[ii].m_idx = invalidHandle; - m_sampler[ii].m_flags = BGFX_SAMPLER_TEXTURE; + m_sampler[ii].m_flags = 0; } } @@ -1178,10 +1176,7 @@ namespace bgfx m_flags |= BGFX_STATE_TEX0<<_stage; Sampler& sampler = m_state.m_sampler[_stage]; sampler.m_idx = _handle.idx; - sampler.m_flags = 0 - | BGFX_SAMPLER_TEXTURE - | ( (_flags&BGFX_SAMPLER_TYPE_MASK) ? BGFX_SAMPLER_DEFAULT_FLAGS : _flags) - ; + sampler.m_flags = (_flags&BGFX_SAMPLER_DEFAULT_FLAGS) ? BGFX_SAMPLER_DEFAULT_FLAGS : _flags; if (isValid(_sampler) ) { diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index cf2a7ec8..d78e5fb7 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -2569,15 +2569,8 @@ namespace bgfx { if (invalidHandle != sampler.m_idx) { - switch (sampler.m_flags&BGFX_SAMPLER_TYPE_MASK) - { - case BGFX_SAMPLER_TEXTURE: - { - Texture& texture = s_renderCtx->m_textures[sampler.m_idx]; - texture.commit(stage, sampler.m_flags); - } - break; - } + Texture& texture = s_renderCtx->m_textures[sampler.m_idx]; + texture.commit(stage, sampler.m_flags); } else { diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index ce439715..8c6e7002 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -160,23 +160,6 @@ namespace bgfx D3DFMT_R32F, }; - static const D3DFORMAT s_depthFormat[] = - { - D3DFMT_UNKNOWN, // ignored - D3DFMT_D16, // D16 - D3DFMT_D24X8, // D24 - D3DFMT_D24S8, // D24S8 - D3DFMT_D32, // D32 - D3DFMT_DF16, // D16F - D3DFMT_DF24, // D24F - D3DFMT_D32F_LOCKABLE, // D32F -#if defined(D3D_DISABLE_9EX) - D3DFMT_UNKNOWN, // D0S8 -#else - D3DFMT_S8_LOCKABLE, // D0S8 -#endif // defined(D3D_DISABLE_9EX) - }; - static const D3DTEXTUREADDRESS s_textureAddress[] = { D3DTADDRESS_WRAP, @@ -2811,12 +2794,7 @@ namespace bgfx { if (invalidHandle != sampler.m_idx) { - switch (sampler.m_flags&BGFX_SAMPLER_TYPE_MASK) - { - case BGFX_SAMPLER_TEXTURE: - s_renderCtx->m_textures[sampler.m_idx].commit(stage, sampler.m_flags); - break; - } + s_renderCtx->m_textures[sampler.m_idx].commit(stage, sampler.m_flags); } else { diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 7c127a85..bf6dfc84 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -3474,15 +3474,8 @@ namespace bgfx { if (invalidHandle != sampler.m_idx) { - switch (sampler.m_flags&BGFX_SAMPLER_TYPE_MASK) - { - case BGFX_SAMPLER_TEXTURE: - { - Texture& texture = s_renderCtx->m_textures[sampler.m_idx]; - texture.commit(stage, sampler.m_flags); - } - break; - } + Texture& texture = s_renderCtx->m_textures[sampler.m_idx]; + texture.commit(stage, sampler.m_flags); } }