mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Fix the pink water in D3D9
This commit is contained in:
parent
3496c549b5
commit
6283a6b9da
1 changed files with 33 additions and 3 deletions
|
|
@ -1127,13 +1127,43 @@ void GFXD3D9Shader::_getShaderConstants( ID3DXConstantTable *table,
|
||||||
case D3DXPC_MATRIX_ROWS :
|
case D3DXPC_MATRIX_ROWS :
|
||||||
case D3DXPC_MATRIX_COLUMNS :
|
case D3DXPC_MATRIX_COLUMNS :
|
||||||
{
|
{
|
||||||
switch (constantDesc.Rows)
|
S32 fd, sd;
|
||||||
|
fd = constantDesc.RegisterCount / constantDesc.Elements;
|
||||||
|
sd = constantDesc.Class == D3DXPC_MATRIX_ROWS ? constantDesc.Columns : constantDesc.Rows;
|
||||||
|
|
||||||
|
switch (fd)
|
||||||
{
|
{
|
||||||
|
case 2 :
|
||||||
|
AssertFatal(sd == 2, "non-square 2x? mats not supported");
|
||||||
|
desc.constType = GFXSCT_Float2x2;
|
||||||
|
break;
|
||||||
case 3 :
|
case 3 :
|
||||||
desc.constType = constantDesc.Columns == 4 ? GFXSCT_Float3x4 : GFXSCT_Float3x3;
|
switch (sd)
|
||||||
|
{
|
||||||
|
case 3 :
|
||||||
|
desc.constType = GFXSCT_Float3x3;
|
||||||
|
break;
|
||||||
|
case 4 :
|
||||||
|
desc.constType = GFXSCT_Float4x3;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
AssertFatal(false, "Unsupported matrix size");
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 4 :
|
case 4 :
|
||||||
desc.constType = constantDesc.Columns == 3 ? GFXSCT_Float4x3 : GFXSCT_Float4x4;
|
switch (sd)
|
||||||
|
{
|
||||||
|
case 3:
|
||||||
|
desc.constType = GFXSCT_Float3x4;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
desc.constType = GFXSCT_Float4x4;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
AssertFatal(false, "Unsupported matrix size");
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue