r600/sfn: Initialize ShaderInputVarying members in constructors.

Fix defects reported by Coverity Scan.

uninit_member: Non-static class member m_interpolate is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member m_lds_pos is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member m_mask is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7909>
This commit is contained in:
Vinson Lee 2020-12-03 15:12:07 -08:00
parent d4ae1950de
commit 34a35d8f2e

View file

@ -120,6 +120,7 @@ ShaderInputVarying::ShaderInputVarying(tgsi_semantic _name, int sid, unsigned dr
m_interpolate(interpolate),
m_interpolate_loc(interp_loc),
m_ij_index(-10),
m_lds_pos(0),
m_mask((1 << components) - 1)
{
evaluate_spi_sid();
@ -139,6 +140,7 @@ ShaderInputVarying::ShaderInputVarying(tgsi_semantic _name, int sid, nir_variabl
m_location_frac(input->data.location_frac),
m_sid(sid),
m_ij_index(-10),
m_lds_pos(0),
m_mask((1 << input->type->components()) - 1)
{
sfn_log << SfnLog::io << __func__
@ -182,6 +184,10 @@ ShaderInputVarying::ShaderInputVarying(tgsi_semantic _name, int sid, nir_variabl
case INTERP_MODE_FLAT:
m_interpolate = TGSI_INTERPOLATE_CONSTANT;
break;
default:
m_interpolate = TGSI_INTERPOLATE_CONSTANT;
break;
}
if (input->data.sample) {
@ -241,7 +247,8 @@ ShaderInputVarying::ShaderInputVarying(tgsi_semantic name,
m_interpolate(orig.m_interpolate),
m_interpolate_loc(orig.m_interpolate_loc),
m_ij_index(orig.m_ij_index),
m_lds_pos(0)
m_lds_pos(0),
m_mask(0)
{
evaluate_spi_sid();
}