Fixed issue #1691.

This commit is contained in:
Branimir Karadžić 2019-03-16 21:52:44 -07:00
parent 4bc541a723
commit 1d52e0bd10
3 changed files with 8 additions and 8 deletions

View File

@ -4164,6 +4164,7 @@ namespace bgfx
| BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB
) );
}
uint16_t srgbCaps = BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB;
if (_cubeMap)
@ -4212,7 +4213,7 @@ namespace bgfx
}
if (0 != (_flags & BGFX_TEXTURE_SRGB)
&& 0 == (g_caps.supported & srgbCaps & (0
&& 0 == (g_caps.formats[_format] & srgbCaps & (0
| BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB
| BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB
| BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB

View File

@ -521,7 +521,7 @@ namespace bgfx
return uint32_t( (_stencil >> (32*_0or1) ) );
}
inline bool needBorderColor(uint32_t _flags)
inline bool needBorderColor(uint64_t _flags)
{
return BGFX_SAMPLER_U_BORDER == (_flags & BGFX_SAMPLER_U_BORDER)
|| BGFX_SAMPLER_V_BORDER == (_flags & BGFX_SAMPLER_V_BORDER)

View File

@ -1734,9 +1734,9 @@ namespace bgfx { namespace d3d9
}
}
void setSamplerState(uint8_t _stage, uint32_t _flags, const float _rgba[4])
void setSamplerState(uint8_t _stage, uint64_t _flags, const float _rgba[4])
{
const uint32_t flags = _flags&( (~BGFX_SAMPLER_RESERVED_MASK) | BGFX_SAMPLER_BITS_MASK | BGFX_TEXTURE_SRGB);
const uint64_t flags = _flags&( (~BGFX_SAMPLER_RESERVED_MASK) | BGFX_SAMPLER_BITS_MASK | BGFX_TEXTURE_SRGB);
BX_CHECK(_stage < BX_COUNTOF(m_samplerFlags), "");
if (m_samplerFlags[_stage] != flags)
{
@ -2242,7 +2242,7 @@ namespace bgfx { namespace d3d9
UniformRegistry m_uniformReg;
void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
uint32_t m_samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
uint64_t m_samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
TextureD3D9* m_updateTexture;
uint8_t* m_updateTextureBits;
@ -3124,9 +3124,8 @@ namespace bgfx { namespace d3d9
void TextureD3D9::commit(uint8_t _stage, uint32_t _flags, const float _palette[][4])
{
const uint32_t flags = 0 == (BGFX_SAMPLER_INTERNAL_DEFAULT & _flags)
? _flags
: uint32_t(m_flags)
const uint64_t flags = (m_flags & BGFX_TEXTURE_SRGB)
| (0 == (BGFX_SAMPLER_INTERNAL_DEFAULT & _flags) ? _flags : uint32_t(m_flags) )
;
uint32_t index = (flags & BGFX_SAMPLER_BORDER_COLOR_MASK) >> BGFX_SAMPLER_BORDER_COLOR_SHIFT;
s_renderD3D9->setSamplerState(_stage, flags, _palette[index]);