d3dx9: Implement ID3DXConstantTable::SetMatrixTranspose.
This commit is contained in:
parent
edbd09fb45
commit
51f4f01308
|
@ -1252,9 +1252,9 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixTranspose(ID3DXConstantTab
|
||||||
{
|
{
|
||||||
struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface);
|
struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface);
|
||||||
|
|
||||||
FIXME("(%p)->(%p, %p, %p): stub\n", This, device, constant, matrix);
|
TRACE("(%p)->(%p, %p, %p)\n", This, device, constant, matrix);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
return set_matrix_array(iface, device, constant, matrix, 1, D3DXPC_MATRIX_COLUMNS, D3DXPT_FLOAT, 4, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixTransposeArray(ID3DXConstantTable *iface, LPDIRECT3DDEVICE9 device,
|
static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixTransposeArray(ID3DXConstantTable *iface, LPDIRECT3DDEVICE9 device,
|
||||||
|
|
|
@ -649,6 +649,7 @@ static void test_setting_basic_table(IDirect3DDevice9 *device)
|
||||||
/* Clear registers */
|
/* Clear registers */
|
||||||
memset(out, 0, sizeof(out));
|
memset(out, 0, sizeof(out));
|
||||||
IDirect3DDevice9_SetVertexShaderConstantF(device, 0, out, 4);
|
IDirect3DDevice9_SetVertexShaderConstantF(device, 0, out, 4);
|
||||||
|
IDirect3DDevice9_SetVertexShaderConstantF(device, 6, out, 1);
|
||||||
IDirect3DDevice9_SetVertexShaderConstantF(device, 7, out, 1);
|
IDirect3DDevice9_SetVertexShaderConstantF(device, 7, out, 1);
|
||||||
|
|
||||||
/* SetVector shouldn't change the value of a matrix constant */
|
/* SetVector shouldn't change the value of a matrix constant */
|
||||||
|
@ -693,6 +694,24 @@ static void test_setting_basic_table(IDirect3DDevice9 *device)
|
||||||
"got {%f, %f, %f, %f}, should be all 0.0f\n",
|
"got {%f, %f, %f, %f}, should be all 0.0f\n",
|
||||||
out[0], out[1], out[2], out[3]);
|
out[0], out[1], out[2], out[3]);
|
||||||
|
|
||||||
|
res = ID3DXConstantTable_SetMatrixTranspose(ctable, device, "f", &mvp);
|
||||||
|
ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixTranspose failed on variable f: 0x%08x\n", res);
|
||||||
|
|
||||||
|
IDirect3DDevice9_GetVertexShaderConstantF(device, 6, out, 1);
|
||||||
|
ok(out[0] == U(S(mvp))._11 && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f,
|
||||||
|
"The variable f was not set correctly by ID3DXConstantTable_SetMatrixTranspose, got %f, should be %f\n",
|
||||||
|
out[0], U(S(mvp))._11);
|
||||||
|
|
||||||
|
res = ID3DXConstantTable_SetMatrixTranspose(ctable, device, "f4", &mvp);
|
||||||
|
ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixTranspose failed on variable f4: 0x%08x\n", res);
|
||||||
|
|
||||||
|
IDirect3DDevice9_GetVertexShaderConstantF(device, 7, out, 1);
|
||||||
|
todo_wine ok(out[0] == S(U(mvp))._11 && out[1] == S(U(mvp))._21 && out[2] == S(U(mvp))._31 && out[3] == S(U(mvp))._41,
|
||||||
|
"The variable f4 was not set correctly by ID3DXConstantTable_SetMatrixTranspose, "
|
||||||
|
"got {%f, %f, %f, %f}, should be {%f, %f, %f, %f}\n",
|
||||||
|
out[0], out[1], out[2], out[3],
|
||||||
|
S(U(mvp))._11, S(U(mvp))._21, S(U(mvp))._31, S(U(mvp))._41);
|
||||||
|
|
||||||
refcnt = ID3DXConstantTable_Release(ctable);
|
refcnt = ID3DXConstantTable_Release(ctable);
|
||||||
ok(refcnt == 0, "The constant table reference count was %u, should be 0\n", refcnt);
|
ok(refcnt == 0, "The constant table reference count was %u, should be 0\n", refcnt);
|
||||||
}
|
}
|
||||||
|
@ -741,6 +760,7 @@ static void test_setting_matrices_table(IDirect3DDevice9 *device)
|
||||||
res = D3DXGetShaderConstantTable(ctab_matrices2, &ctable);
|
res = D3DXGetShaderConstantTable(ctab_matrices2, &ctable);
|
||||||
ok(res == D3D_OK, "D3DXGetShaderConstantTable failed: got %#x\n", res);
|
ok(res == D3D_OK, "D3DXGetShaderConstantTable failed: got %#x\n", res);
|
||||||
|
|
||||||
|
/* SetMatrix */
|
||||||
res = ID3DXConstantTable_SetMatrix(ctable, device, "c2x3", &fmatrix);
|
res = ID3DXConstantTable_SetMatrix(ctable, device, "c2x3", &fmatrix);
|
||||||
ok(res == D3D_OK, "ID3DXConstantTable_SetMatrix failed on variable c2x3: got %#x\n", res);
|
ok(res == D3D_OK, "ID3DXConstantTable_SetMatrix failed on variable c2x3: got %#x\n", res);
|
||||||
|
|
||||||
|
@ -826,6 +846,35 @@ static void test_setting_matrices_table(IDirect3DDevice9 *device)
|
||||||
S(U(fmatrix))._31, S(U(fmatrix))._32, S(U(fmatrix))._33, S(U(fmatrix))._34,
|
S(U(fmatrix))._31, S(U(fmatrix))._32, S(U(fmatrix))._33, S(U(fmatrix))._34,
|
||||||
S(U(fmatrix))._41, S(U(fmatrix))._42, S(U(fmatrix))._43, S(U(fmatrix))._44);
|
S(U(fmatrix))._41, S(U(fmatrix))._42, S(U(fmatrix))._43, S(U(fmatrix))._44);
|
||||||
|
|
||||||
|
/* SetMatrixTranspose */
|
||||||
|
res = ID3DXConstantTable_SetMatrixTranspose(ctable, device, "c2x3", &fmatrix);
|
||||||
|
ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixTranspose failed on variable c2x3: got %#x\n", res);
|
||||||
|
|
||||||
|
res = ID3DXConstantTable_SetMatrixTranspose(ctable, device, "r2x3", &fmatrix);
|
||||||
|
ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixTranspose failed on variable r2x3: got %#x\n", res);
|
||||||
|
|
||||||
|
IDirect3DDevice9_GetVertexShaderConstantF(device, 7, out, 3);
|
||||||
|
ok(out[0] == S(U(fmatrix))._11 && out[1] == S(U(fmatrix))._12 && out[2] == 0.0f && out[3] == 0.0f
|
||||||
|
&& out[4] == S(U(fmatrix))._21 && out[5] == S(U(fmatrix))._22 && out[6] == 0.0f && out[7] == 0.0f
|
||||||
|
&& out[8] == S(U(fmatrix))._31 && out[9] == S(U(fmatrix))._32 && out[10] == 0.0f && out[11] == 0.0f,
|
||||||
|
"The variable c2x3 was not set correctly, out={%f, %f, %f, %f; %f, %f, %f, %f; %f, %f, %f, %f}, "
|
||||||
|
"should be {%f, %f, %f, %f; %f, %f, %f, %f; %f, %f, %f, %f}\n",
|
||||||
|
out[0], out[1], out[2], out[3],
|
||||||
|
out[4], out[5], out[6], out[7],
|
||||||
|
out[8], out[9], out[10], out[11],
|
||||||
|
S(U(fmatrix))._11, S(U(fmatrix))._12, 0.0f, 0.0f,
|
||||||
|
S(U(fmatrix))._21, S(U(fmatrix))._22, 0.0f, 0.0f,
|
||||||
|
S(U(fmatrix))._31, S(U(fmatrix))._32, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
IDirect3DDevice9_GetVertexShaderConstantF(device, 15, out, 2);
|
||||||
|
ok(out[0] == S(U(fmatrix))._11 && out[1] == S(U(fmatrix))._21 && out[2] == S(U(fmatrix))._31 && out[3] == 0.0f
|
||||||
|
&& out[4] == S(U(fmatrix))._12 && out[5] == S(U(fmatrix))._22 && out[6] == S(U(fmatrix))._32 && out[7] == 0.0f,
|
||||||
|
"The variable r2x3 was not set correctly, out={%f, %f, %f, %f; %f, %f, %f, %f}, "
|
||||||
|
"should be {%f, %f, %f, %f; %f, %f, %f, %f}\n",
|
||||||
|
out[0], out[1], out[2], out[3], out[4], out[5], out[6], out[7],
|
||||||
|
S(U(fmatrix))._11, S(U(fmatrix))._21, S(U(fmatrix))._31, 0.0f,
|
||||||
|
S(U(fmatrix))._12, S(U(fmatrix))._22, S(U(fmatrix))._32, 0.0f);
|
||||||
|
|
||||||
ID3DXConstantTable_Release(ctable);
|
ID3DXConstantTable_Release(ctable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue