mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
PixelShaderGen: Change indirect texture matrix uniforms to use integers.
This commit is contained in:
@ -210,26 +210,25 @@ void PixelShaderManager::SetIndTexScaleChanged(bool high)
|
||||
void PixelShaderManager::SetIndMatrixChanged(int matrixidx)
|
||||
{
|
||||
int scale = ((u32)bpmem.indmtx[matrixidx].col0.s0 << 0) |
|
||||
((u32)bpmem.indmtx[matrixidx].col1.s1 << 2) |
|
||||
((u32)bpmem.indmtx[matrixidx].col2.s2 << 4);
|
||||
float fscale = powf(2.0f, (float)(scale - 17)) / 8.0f;
|
||||
((u32)bpmem.indmtx[matrixidx].col1.s1 << 2) |
|
||||
((u32)bpmem.indmtx[matrixidx].col2.s2 << 4);
|
||||
|
||||
// xyz - static matrix
|
||||
// w - dynamic matrix scale / 128
|
||||
constants.indtexmtx[2*matrixidx][0] = bpmem.indmtx[matrixidx].col0.ma * fscale;
|
||||
constants.indtexmtx[2*matrixidx][1] = bpmem.indmtx[matrixidx].col1.mc * fscale;
|
||||
constants.indtexmtx[2*matrixidx][2] = bpmem.indmtx[matrixidx].col2.me * fscale;
|
||||
constants.indtexmtx[2*matrixidx][3] = fscale / 128.0f;
|
||||
constants.indtexmtx[2*matrixidx+1][0] = bpmem.indmtx[matrixidx].col0.mb * fscale;
|
||||
constants.indtexmtx[2*matrixidx+1][1] = bpmem.indmtx[matrixidx].col1.md * fscale;
|
||||
constants.indtexmtx[2*matrixidx+1][2] = bpmem.indmtx[matrixidx].col2.mf * fscale;
|
||||
constants.indtexmtx[2*matrixidx+1][3] = fscale / 128.0f;
|
||||
constants.indtexmtx[2*matrixidx ][0] = bpmem.indmtx[matrixidx].col0.ma;
|
||||
constants.indtexmtx[2*matrixidx ][1] = bpmem.indmtx[matrixidx].col1.mc;
|
||||
constants.indtexmtx[2*matrixidx ][2] = bpmem.indmtx[matrixidx].col2.me;
|
||||
constants.indtexmtx[2*matrixidx ][3] = 17 - scale;
|
||||
constants.indtexmtx[2*matrixidx+1][0] = bpmem.indmtx[matrixidx].col0.mb;
|
||||
constants.indtexmtx[2*matrixidx+1][1] = bpmem.indmtx[matrixidx].col1.md;
|
||||
constants.indtexmtx[2*matrixidx+1][2] = bpmem.indmtx[matrixidx].col2.mf;
|
||||
constants.indtexmtx[2*matrixidx+1][3] = 17 - scale;
|
||||
dirty = true;
|
||||
|
||||
PRIM_LOG("indmtx%d: scale=%f, mat=(%f %f %f; %f %f %f)\n",
|
||||
matrixidx, fscale,
|
||||
bpmem.indmtx[matrixidx].col0.ma * fscale, bpmem.indmtx[matrixidx].col1.mc * fscale, bpmem.indmtx[matrixidx].col2.me * fscale,
|
||||
bpmem.indmtx[matrixidx].col0.mb * fscale, bpmem.indmtx[matrixidx].col1.md * fscale, bpmem.indmtx[matrixidx].col2.mf * fscale);
|
||||
PRIM_LOG("indmtx%d: scale=%d, mat=(%d %d %d; %d %d %d)\n",
|
||||
matrixidx, scale,
|
||||
bpmem.indmtx[matrixidx].col0.ma, bpmem.indmtx[matrixidx].col1.mc, bpmem.indmtx[matrixidx].col2.me,
|
||||
bpmem.indmtx[matrixidx].col0.mb, bpmem.indmtx[matrixidx].col1.md, bpmem.indmtx[matrixidx].col2.mf);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user