Fixed static analysis issues from #1535.

This commit is contained in:
Branimir Karadžić 2018-10-28 15:16:47 -07:00
parent 5b704808d6
commit 12a5bc959b
2 changed files with 3 additions and 3 deletions

View File

@ -3112,7 +3112,7 @@ namespace bgfx
return false;
}
if (1 <= _init.limits.maxEncoders
if (1 >= _init.limits.maxEncoders
&& 128 <= _init.limits.maxEncoders)
{
BX_TRACE("init.limits.maxEncoders must be between 1 and 128.");

View File

@ -1921,8 +1921,8 @@ namespace bgfx { namespace d3d12
m_commandList->SetGraphicsRootConstantBufferView(Rdt::CBV, gpuAddress);
TextureD3D12& texture = m_textures[_blitter.m_texture.idx];
uint32_t samplerFlags[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS] = { uint32_t(texture.m_flags & BGFX_SAMPLER_BITS_MASK) };
uint16_t samplerStateIdx = getSamplerState(samplerFlags, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS, NULL);
uint32_t samplerFlags[] = { uint32_t(texture.m_flags & BGFX_SAMPLER_BITS_MASK) };
uint16_t samplerStateIdx = getSamplerState(samplerFlags, BX_COUNTOF(samplerFlags), NULL);
m_commandList->SetGraphicsRootDescriptorTable(Rdt::Sampler, m_samplerAllocator.get(samplerStateIdx) );
D3D12_GPU_DESCRIPTOR_HANDLE srvHandle;
scratchBuffer.allocSrv(srvHandle, texture);