Fixed possible bug in computing sampler id
Former-commit-id: 29c20403571218c05e3d4405482bb312adda5a35
This commit is contained in:
parent
f45a9d5bf6
commit
28471925ac
|
|
@ -57,7 +57,7 @@ void NzTextureSampler::SetAnisotropyLevel(nzUInt8 anisotropyLevel)
|
||||||
{
|
{
|
||||||
if (anisotropyLevel > s_maxAnisotropyLevel)
|
if (anisotropyLevel > s_maxAnisotropyLevel)
|
||||||
{
|
{
|
||||||
NazaraWarning("Anisotropy level is over maximum anisotropy level (" + NzString::Number(anisotropyLevel) + " > " + NzString::Number(s_maxAnisotropyLevel));
|
NazaraWarning("Anisotropy level is over maximum anisotropy level (" + NzString::Number(anisotropyLevel) + " > " + NzString::Number(s_maxAnisotropyLevel) + ')');
|
||||||
anisotropyLevel = s_maxAnisotropyLevel;
|
anisotropyLevel = s_maxAnisotropyLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -299,10 +299,10 @@ unsigned int NzTextureSampler::GetOpenGLID() const
|
||||||
|
|
||||||
void NzTextureSampler::UpdateSamplerId() const
|
void NzTextureSampler::UpdateSamplerId() const
|
||||||
{
|
{
|
||||||
nzUInt32 key = (m_mipmaps << 0) | // 1 bit
|
nzUInt32 key = (((m_mipmaps) ? 1 : 0) << 0) | // 1 bit
|
||||||
(m_filterMode << 1) | // 2 bits
|
(m_filterMode << 1) | // 2 bits
|
||||||
(m_wrapMode << 3) | // 2 bits
|
(m_wrapMode << 3) | // 2 bits
|
||||||
(m_anisotropicLevel << 5); // 8 bits
|
(m_anisotropicLevel << 5); // 8 bits
|
||||||
|
|
||||||
auto it = s_samplers.find(key);
|
auto it = s_samplers.find(key);
|
||||||
if (it == s_samplers.end())
|
if (it == s_samplers.end())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue