diff options
| author | Jules Blok <jules.blok@gmail.com> | 2014-12-16 00:21:07 +0100 |
|---|---|---|
| committer | Jules Blok <jules.blok@gmail.com> | 2014-12-18 00:36:40 +0100 |
| commit | 0ac710339100dc6dc2f1f4c094b372846decdce5 (patch) | |
| tree | 82abca80ccaad94194ab6d35eadbffc3883c5b77 /Source/Core/VideoCommon/GeometryShaderManager.cpp | |
| parent | d115048615864591125cd1b918bdd923b5b63058 (diff) | |
GeometryShaderGen: Pack uniforms more tightly.
Diffstat (limited to 'Source/Core/VideoCommon/GeometryShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/GeometryShaderManager.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/GeometryShaderManager.cpp b/Source/Core/VideoCommon/GeometryShaderManager.cpp index 70bb151666..3d05a7161c 100644 --- a/Source/Core/VideoCommon/GeometryShaderManager.cpp +++ b/Source/Core/VideoCommon/GeometryShaderManager.cpp @@ -15,8 +15,8 @@ // track changes static bool s_projection_changed, s_viewport_changed, s_lineptwidth_changed; -static const float LINE_PT_TEX_OFFSETS[8] = { - 0.f, 0.0625f, 0.125f, 0.25f, 0.5f, 1.f, 1.f, 1.f +static const int LINE_PT_TEX_OFFSETS[8] = { + 0, 16, 8, 4, 2, 1, 1, 1 }; GeometryShaderConstants GeometryShaderManager::constants; @@ -56,16 +56,16 @@ void GeometryShaderManager::SetConstants() { if (s_lineptwidth_changed) { - constants.lineptwidth[0] = bpmem.lineptwidth.linesize / 6.f; - constants.lineptwidth[1] = bpmem.lineptwidth.pointsize / 6.f; - constants.lineptwidth[2] = LINE_PT_TEX_OFFSETS[bpmem.lineptwidth.lineoff]; - constants.lineptwidth[3] = LINE_PT_TEX_OFFSETS[bpmem.lineptwidth.pointoff]; + constants.lineptparams[2] = bpmem.lineptwidth.linesize / 6.f; + constants.lineptparams[3] = bpmem.lineptwidth.pointsize / 6.f; + constants.texoffset[2] = LINE_PT_TEX_OFFSETS[bpmem.lineptwidth.lineoff]; + constants.texoffset[3] = LINE_PT_TEX_OFFSETS[bpmem.lineptwidth.pointoff]; } if (s_viewport_changed) { - constants.viewport[0] = 2.0f * xfmem.viewport.wd; - constants.viewport[1] = -2.0f * xfmem.viewport.ht; + constants.lineptparams[0] = 2.0f * xfmem.viewport.wd; + constants.lineptparams[1] = -2.0f * xfmem.viewport.ht; } if (s_projection_changed) @@ -106,7 +106,11 @@ void GeometryShaderManager::SetLinePtWidthChanged() void GeometryShaderManager::SetTexCoordChanged(u8 texmapid) { TCoordInfo& tc = bpmem.texcoords[texmapid]; - constants.texoffsetflags[texmapid] = tc.s.line_offset + tc.s.point_offset * 2; + int bitmask = 1 << texmapid; + constants.texoffset[0] &= ~bitmask; + constants.texoffset[0] |= tc.s.line_offset << texmapid; + constants.texoffset[1] &= ~bitmask; + constants.texoffset[1] |= tc.s.point_offset << texmapid; dirty = true; } |
