Merge pull request #232 from lioncash/blur2

CPhazonSuitFilter: Convert define into local variable
This commit is contained in:
Luke Street 2020-03-16 16:14:25 -04:00 committed by GitHub
commit 4a64d92433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -30,8 +30,6 @@ void CPhazonSuitFilter::Shutdown() {
s_BlurPipeline.reset(); s_BlurPipeline.reset();
} }
#define BLUR_SCALE (1.f / 128.f)
void CPhazonSuitFilter::drawBlurPasses(float radius, const CTexture* indTex) { void CPhazonSuitFilter::drawBlurPasses(float radius, const CTexture* indTex) {
SCOPED_GRAPHICS_DEBUG_GROUP("CPhazonSuitFilter::drawBlurPasses", zeus::skMagenta); SCOPED_GRAPHICS_DEBUG_GROUP("CPhazonSuitFilter::drawBlurPasses", zeus::skMagenta);
if (!m_dataBind || indTex != m_indTex) { if (!m_dataBind || indTex != m_indTex) {
@ -120,9 +118,10 @@ void CPhazonSuitFilter::drawBlurPasses(float radius, const CTexture* indTex) {
rect.xc_width = g_Viewport.x8_width; rect.xc_width = g_Viewport.x8_width;
rect.x10_height = g_Viewport.xc_height; rect.x10_height = g_Viewport.xc_height;
constexpr float blurScale = 1.0f / 128.0f;
/* X Pass */ /* X Pass */
zeus::CVector4f blurDir = auto blurDir = zeus::CVector4f{g_Viewport.xc_height / float(g_Viewport.x8_width) * radius * blurScale, 0.f, 0.f, 0.f};
zeus::CVector4f{g_Viewport.xc_height / float(g_Viewport.x8_width) * radius * BLUR_SCALE, 0.f, 0.f, 0.f};
m_uniBufBlurX->load(&blurDir, sizeof(zeus::CVector4f)); m_uniBufBlurX->load(&blurDir, sizeof(zeus::CVector4f));
CGraphics::SetShaderDataBinding(m_dataBindBlurX); CGraphics::SetShaderDataBinding(m_dataBindBlurX);
@ -130,7 +129,7 @@ void CPhazonSuitFilter::drawBlurPasses(float radius, const CTexture* indTex) {
CGraphics::ResolveSpareTexture(rect, 2); CGraphics::ResolveSpareTexture(rect, 2);
/* Y Pass */ /* Y Pass */
blurDir = zeus::CVector4f{0.f, radius * BLUR_SCALE, 0.f, 0.f}; blurDir = zeus::CVector4f{0.f, radius * blurScale, 0.f, 0.f};
m_uniBufBlurY->load(&blurDir, sizeof(zeus::CVector4f)); m_uniBufBlurY->load(&blurDir, sizeof(zeus::CVector4f));
CGraphics::SetShaderDataBinding(m_dataBindBlurY); CGraphics::SetShaderDataBinding(m_dataBindBlurY);