mirror of https://github.com/PCSX2/pcsx2.git
GS: Fix Using memset() on struct which contains a floating point number warning.
Codacy.
This commit is contained in:
parent
1b983111f6
commit
2a9c379a1c
|
@ -2019,16 +2019,16 @@ void GSDevice11::OMSetDepthStencilState(ID3D11DepthStencilState* dss, u8 sref)
|
|||
}
|
||||
}
|
||||
|
||||
void GSDevice11::OMSetBlendState(ID3D11BlendState* bs, float bf)
|
||||
void GSDevice11::OMSetBlendState(ID3D11BlendState* bs, u8 bf)
|
||||
{
|
||||
if (m_state.bs != bs || m_state.bf != bf)
|
||||
{
|
||||
m_state.bs = bs;
|
||||
m_state.bf = bf;
|
||||
|
||||
const float BlendFactor[] = {bf, bf, bf, 0};
|
||||
const GSVector4 col(static_cast<float>(bf) / 128.0f);
|
||||
|
||||
m_ctx->OMSetBlendState(bs, BlendFactor, 0xffffffff);
|
||||
m_ctx->OMSetBlendState(bs, col.v, 0xffffffff);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ private:
|
|||
ID3D11DepthStencilState* dss;
|
||||
u8 sref;
|
||||
ID3D11BlendState* bs;
|
||||
float bf;
|
||||
u8 bf;
|
||||
ID3D11RenderTargetView* rt_view;
|
||||
ID3D11DepthStencilView* dsv;
|
||||
} m_state;
|
||||
|
@ -352,7 +352,7 @@ public:
|
|||
void PSSetSamplerState(ID3D11SamplerState* ss0);
|
||||
|
||||
void OMSetDepthStencilState(ID3D11DepthStencilState* dss, u8 sref);
|
||||
void OMSetBlendState(ID3D11BlendState* bs, float bf);
|
||||
void OMSetBlendState(ID3D11BlendState* bs, u8 bf);
|
||||
void OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector4i* scissor = nullptr);
|
||||
void SetViewport(const GSVector2i& viewport);
|
||||
void SetScissor(const GSVector4i& scissor);
|
||||
|
|
|
@ -334,5 +334,5 @@ void GSDevice11::SetupOM(OMDepthStencilSelector dssel, OMBlendSelector bsel, u8
|
|||
j = m_om_bs.try_emplace(bsel, std::move(bs)).first;
|
||||
}
|
||||
|
||||
OMSetBlendState(j->second.get(), (float)(int)afix / 0x80);
|
||||
OMSetBlendState(j->second.get(), afix);
|
||||
}
|
||||
|
|
|
@ -2230,7 +2230,7 @@ void GSDeviceOGL::OMSetBlendState(bool enable, GLenum src_factor, GLenum dst_fac
|
|||
if (is_constant && GLState::bf != constant)
|
||||
{
|
||||
GLState::bf = constant;
|
||||
const float bf = (float)constant / 128.0f;
|
||||
const float bf = static_cast<float>(constant) / 128.0f;
|
||||
glBlendColor(bf, bf, bf, bf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue