mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Cleanup.
This commit is contained in:
parent
7adfc7856a
commit
54be2d5b77
5 changed files with 12 additions and 15 deletions
|
@ -314,6 +314,14 @@ namespace bgfx
|
|||
return uint32_t( (_stencil >> (32*_0or1) ) );
|
||||
}
|
||||
|
||||
inline bool needBorderColor(uint32_t _flags)
|
||||
{
|
||||
return BGFX_TEXTURE_U_BORDER == (_flags & BGFX_TEXTURE_U_BORDER)
|
||||
|| BGFX_TEXTURE_V_BORDER == (_flags & BGFX_TEXTURE_V_BORDER)
|
||||
|| BGFX_TEXTURE_W_BORDER == (_flags & BGFX_TEXTURE_W_BORDER)
|
||||
;
|
||||
}
|
||||
|
||||
void dump(const VertexDecl& _decl);
|
||||
|
||||
struct TextVideoMem
|
||||
|
|
|
@ -2535,9 +2535,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|||
|
||||
uint32_t hash;
|
||||
ID3D11SamplerState* sampler;
|
||||
if (BGFX_TEXTURE_U_BORDER != (_flags & BGFX_TEXTURE_U_BORDER)
|
||||
&& BGFX_TEXTURE_V_BORDER != (_flags & BGFX_TEXTURE_V_BORDER)
|
||||
&& BGFX_TEXTURE_W_BORDER != (_flags & BGFX_TEXTURE_W_BORDER) )
|
||||
if (!needBorderColor(_flags) )
|
||||
{
|
||||
bx::HashMurmur2A murmur;
|
||||
murmur.begin();
|
||||
|
|
|
@ -2810,14 +2810,9 @@ data.NumQualityLevels = 0;
|
|||
sd.ComparisonFunc = 0 == cmpFunc ? D3D12_COMPARISON_FUNC_NEVER : s_cmpFunc[cmpFunc];
|
||||
|
||||
uint32_t index = (flags & BGFX_TEXTURE_BORDER_COLOR_MASK) >> BGFX_TEXTURE_BORDER_COLOR_SHIFT;
|
||||
const bool needBorderColor = false
|
||||
|| BGFX_TEXTURE_U_BORDER == (flags & BGFX_TEXTURE_U_BORDER)
|
||||
|| BGFX_TEXTURE_V_BORDER == (flags & BGFX_TEXTURE_V_BORDER)
|
||||
|| BGFX_TEXTURE_W_BORDER == (flags & BGFX_TEXTURE_W_BORDER)
|
||||
;
|
||||
|
||||
if (NULL != _palette
|
||||
&& needBorderColor)
|
||||
&& needBorderColor(flags) )
|
||||
{
|
||||
const float* rgba = _palette[index];
|
||||
sd.BorderColor[0] = rgba[0];
|
||||
|
|
|
@ -1454,9 +1454,7 @@ namespace bgfx { namespace d3d9
|
|||
setSamplerState(device, _stage, D3DSAMP_SRGBTEXTURE, 0 != (flags & BGFX_TEXTURE_SRGB) );
|
||||
if (NULL != _rgba)
|
||||
{
|
||||
if (BGFX_TEXTURE_U_BORDER == (_flags & BGFX_TEXTURE_U_BORDER)
|
||||
|| BGFX_TEXTURE_V_BORDER == (_flags & BGFX_TEXTURE_V_BORDER)
|
||||
|| BGFX_TEXTURE_W_BORDER == (_flags & BGFX_TEXTURE_W_BORDER) )
|
||||
if (needBorderColor(_flags) )
|
||||
{
|
||||
DWORD bc = D3DCOLOR_COLORVALUE(_rgba[0], _rgba[1], _rgba[2], _rgba[3]);
|
||||
setSamplerState(device
|
||||
|
|
|
@ -2540,9 +2540,7 @@ namespace bgfx { namespace gl
|
|||
|
||||
murmur.begin();
|
||||
murmur.add(_flags);
|
||||
if (BGFX_TEXTURE_U_BORDER != (_flags & BGFX_TEXTURE_U_BORDER)
|
||||
&& BGFX_TEXTURE_V_BORDER != (_flags & BGFX_TEXTURE_V_BORDER)
|
||||
&& BGFX_TEXTURE_W_BORDER != (_flags & BGFX_TEXTURE_W_BORDER) )
|
||||
if (!needBorderColor(_flags) )
|
||||
{
|
||||
murmur.add(-1);
|
||||
hash = murmur.end();
|
||||
|
|
Loading…
Reference in a new issue