winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
July
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2012
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
541 discussions
Start a n
N
ew thread
Józef Kucia : d3dx9: Implement ID3DXConstantTable:: SetMatrixTranspose.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: 51f4f013089b4d1fa02eb445341475b38f5a049a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=51f4f013089b4d1fa02eb4453…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Tue Aug 21 14:52:18 2012 +0200 d3dx9: Implement ID3DXConstantTable::SetMatrixTranspose. --- dlls/d3dx9_36/shader.c | 4 +- dlls/d3dx9_36/tests/shader.c | 49 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 11835eb..01b2e7c 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -1252,9 +1252,9 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixTranspose(ID3DXConstantTab { 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, diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c index 2ecb802..caa0f0b 100644 --- a/dlls/d3dx9_36/tests/shader.c +++ b/dlls/d3dx9_36/tests/shader.c @@ -649,6 +649,7 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) /* Clear registers */ memset(out, 0, sizeof(out)); IDirect3DDevice9_SetVertexShaderConstantF(device, 0, out, 4); + IDirect3DDevice9_SetVertexShaderConstantF(device, 6, out, 1); IDirect3DDevice9_SetVertexShaderConstantF(device, 7, out, 1); /* 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", 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); 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); ok(res == D3D_OK, "D3DXGetShaderConstantTable failed: got %#x\n", res); + /* SetMatrix */ res = ID3DXConstantTable_SetMatrix(ctable, device, "c2x3", &fmatrix); 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))._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); }
1
0
0
0
Józef Kucia : d3dx9: Implement ID3DXConstantTable:: SetMatrixTransposeArray.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: edbd09fb4521a98692bc29b3afd1e7f17d7568dd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=edbd09fb4521a98692bc29b3a…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Tue Aug 21 14:52:17 2012 +0200 d3dx9: Implement ID3DXConstantTable::SetMatrixTransposeArray. --- dlls/d3dx9_36/shader.c | 108 +++++++++++++++++++++++++++++++---------------- 1 files changed, 71 insertions(+), 37 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 33e3aeb..11835eb 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -961,15 +961,47 @@ static HRESULT set_vector_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev return D3D_OK; } +static HRESULT set_float_matrix(FLOAT *matrix, const D3DXCONSTANT_DESC *desc, + UINT row_offset, UINT column_offset, UINT rows, UINT columns, + const void *data, D3DXPARAMETER_TYPE type, UINT src_columns) +{ + UINT i, j; + + switch (type) + { + case D3DXPT_FLOAT: + for (i = 0; i < rows; i++) + { + for (j = 0; j < columns; j++) + matrix[i * row_offset + j * column_offset] = ((FLOAT *)data)[i * src_columns + j]; + } + break; + case D3DXPT_INT: + for (i = 0; i < rows; i++) + { + for (j = 0; j < columns; j++) + matrix[i * row_offset + j * column_offset] = ((INT *)data)[i * src_columns + j]; + } + break; + default: + FIXME("Unhandled type %#x", type); + return D3DERR_INVALIDCALL; + } + + return D3D_OK; +} + static HRESULT set_matrix_array(ID3DXConstantTable *iface, IDirect3DDevice9 *device, D3DXHANDLE constant, const void *data, - UINT count, D3DXPARAMETER_TYPE type, UINT rows, UINT columns) + UINT count, D3DXPARAMETER_CLASS class, D3DXPARAMETER_TYPE type, UINT rows, UINT columns) { struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface); D3DXCONSTANT_DESC desc; HRESULT hr; UINT registers_per_matrix; - UINT i, j, k, desc_count = 1; + UINT i, desc_count = 1; + UINT num_rows, num_columns; UINT row_offset, column_offset; + const DWORD *data_ptr; FLOAT matrix[16] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, @@ -982,22 +1014,38 @@ static HRESULT set_matrix_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev return D3DERR_INVALIDCALL; } - if (desc.Class == D3DXPC_MATRIX_COLUMNS) - { - column_offset = 4; - row_offset = 1; - registers_per_matrix = desc.Columns; - } - else if (desc.Class == D3DXPC_MATRIX_ROWS) + if (desc.Class == D3DXPC_MATRIX_ROWS || desc.Class == D3DXPC_MATRIX_COLUMNS) { - column_offset = 1; - row_offset = 4; - registers_per_matrix = desc.Rows; + if (desc.Class == class) + { + column_offset = 1; + row_offset = 4; + } + else + { + column_offset = 4; + row_offset = 1; + } + + if (class == D3DXPC_MATRIX_ROWS) + { + num_rows = min(desc.Rows, rows); + num_columns = min(desc.Columns, columns); + } + else + { + num_rows = min(desc.Columns, columns); + num_columns = min(desc.Rows, rows); + } + + registers_per_matrix = (desc.Class == D3DXPC_MATRIX_ROWS) ? desc.Rows : desc.Columns; } else if (desc.Class == D3DXPC_SCALAR) { column_offset = 1; row_offset = 1; + num_rows = min(desc.Rows, rows); + num_columns = min(desc.Columns, columns); registers_per_matrix = 1; } else @@ -1009,33 +1057,18 @@ static HRESULT set_matrix_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev switch (desc.RegisterSet) { case D3DXRS_FLOAT4: + data_ptr = data; for (i = 0; i < count; i++) { if (registers_per_matrix * (i + 1) > desc.RegisterCount) break; - switch (type) - { - case D3DXPT_FLOAT: - for (j = 0; j < min(desc.Rows, rows); j++) - { - for (k = 0; k < min(desc.Columns, columns); k++) - matrix[j * row_offset + k * column_offset] = ((float *)data)[i * rows * columns + j * columns + k]; - } - break; - case D3DXPT_INT: - for (j = 0; j < min(desc.Rows, rows); j++) - { - for (k = 0; k < min(desc.Columns, columns); k++) - matrix[j * row_offset + k * column_offset] = (float)((int *)data)[i * rows * columns + j * columns + k]; - } - break; - default: - FIXME("Unhandled type %#x", type); - return D3DERR_INVALIDCALL; - } + hr = set_float_matrix(matrix, &desc, row_offset, column_offset, num_rows, num_columns, data_ptr, type, columns); + if (FAILED(hr)) return hr; set_float_shader_constant(This, device, desc.RegisterIndex + i * registers_per_matrix, matrix, registers_per_matrix); + + data_ptr += rows * columns; } break; default: @@ -1097,7 +1130,8 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetValue(ID3DXConstantTable *iface, return set_vector_array(iface, device, constant, data,elements, desc.Type); case D3DXPC_MATRIX_ROWS: case D3DXPC_MATRIX_COLUMNS: - return set_matrix_array(iface, device, constant, data, elements, desc.Type, desc.Rows, desc.Columns); + return set_matrix_array(iface, device, constant, data, elements, + D3DXPC_MATRIX_ROWS, desc.Type, desc.Rows, desc.Columns); default: FIXME("Unhandled parameter class %#x", desc.Class); return D3DERR_INVALIDCALL; @@ -1190,7 +1224,7 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrix(ID3DXConstantTable *iface TRACE("(%p)->(%p, %p, %p)\n", This, device, constant, matrix); - return set_matrix_array(iface, device, constant, matrix, 1, D3DXPT_FLOAT, 4, 4); + return set_matrix_array(iface, device, constant, matrix, 1, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4); } static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixArray(ID3DXConstantTable *iface, LPDIRECT3DDEVICE9 device, @@ -1200,7 +1234,7 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixArray(ID3DXConstantTable * TRACE("(%p)->(%p, %p, %p, %d)\n", This, device, constant, matrix, count); - return set_matrix_array(iface, device, constant, matrix, count, D3DXPT_FLOAT, 4, 4); + return set_matrix_array(iface, device, constant, matrix, count, D3DXPC_MATRIX_ROWS, D3DXPT_FLOAT, 4, 4); } static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixPointerArray(ID3DXConstantTable *iface, LPDIRECT3DDEVICE9 device, @@ -1228,9 +1262,9 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixTransposeArray(ID3DXConsta { struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface); - FIXME("(%p)->(%p, %p, %p, %d): stub\n", This, device, constant, matrix, count); + TRACE("(%p)->(%p, %p, %p, %d)\n", This, device, constant, matrix, count); - return E_NOTIMPL; + return set_matrix_array(iface, device, constant, matrix, count, D3DXPC_MATRIX_COLUMNS, D3DXPT_FLOAT, 4, 4); } static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixTransposePointerArray(ID3DXConstantTable *iface, LPDIRECT3DDEVICE9 device,
1
0
0
0
Józef Kucia : d3dx9: ID3DXConstantTable:: SetFloat shouldn't change the value of matrix and vector constants.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: aaac25dc67a1b2dd47144102dd0c38d79df8a8dd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aaac25dc67a1b2dd47144102d…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Tue Aug 21 14:52:16 2012 +0200 d3dx9: ID3DXConstantTable::SetFloat shouldn't change the value of matrix and vector constants. --- dlls/d3dx9_36/shader.c | 3 +++ dlls/d3dx9_36/tests/shader.c | 28 +++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index d5d5018..33e3aeb 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -873,6 +873,9 @@ static HRESULT set_scalar_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev return D3DERR_INVALIDCALL; } + if (desc.Class != D3DXPC_SCALAR) + return D3D_OK; + switch (desc.RegisterSet) { case D3DXRS_FLOAT4: diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c index 12725f2..2ecb802 100644 --- a/dlls/d3dx9_36/tests/shader.c +++ b/dlls/d3dx9_36/tests/shader.c @@ -623,7 +623,7 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) out[0], out[1], out[2], out[3], f); IDirect3DDevice9_GetVertexShaderConstantF(device, 7, out, 1); - ok(memcmp(out, (void*)&f4, sizeof(f4)) == 0, + ok(memcmp(out, &f4, sizeof(f4)) == 0, "The variable f4 was not set correctly, out={%f, %f, %f, %f}, should be {%f, %f, %f, %f}\n", out[0], out[1], out[2], out[3], f4.x, f4.y, f4.z, f4.w); @@ -649,6 +649,7 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) /* Clear registers */ memset(out, 0, sizeof(out)); IDirect3DDevice9_SetVertexShaderConstantF(device, 0, out, 4); + IDirect3DDevice9_SetVertexShaderConstantF(device, 7, out, 1); /* SetVector shouldn't change the value of a matrix constant */ res = ID3DXConstantTable_SetVector(ctable, device, "mvp", &f4); @@ -667,6 +668,31 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) out[8], out[9], out[10], out[11], out[12], out[13], out[14], out[15]); + res = ID3DXConstantTable_SetFloat(ctable, device, "mvp", f); + ok(res == D3D_OK, "ID3DXConstantTable_SetFloat failed on variable mvp: 0x%08x\n", res); + + IDirect3DDevice9_GetVertexShaderConstantF(device, 0, out, 4); + ok(out[0] == 0.0f && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f + && out[4] == 0.0f && out[5] == 0.0f && out[6] == 0.0f && out[7] == 0.0f + && out[8] == 0.0f && out[9] == 0.0f && out[10] == 0.0f && out[11] == 0.0f + && out[12] == 0.0f && out[13] == 0.0f && out[14] == 0.0f && out[15] == 0.0f, + "The variable mvp was not set correctly by ID3DXConstantTable_SetFloat, " + "got {%f, %f, %f, %f; %f, %f, %f, %f; %f, %f, %f %f; %f, %f, %f, %f}, " + "should be all 0.0f\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], + out[12], out[13], out[14], out[15]); + + res = ID3DXConstantTable_SetFloat(ctable, device, "f4", f); + ok(res == D3D_OK, "ID3DXConstantTable_SetFloat failed on variable f4: 0x%08x\n", res); + + IDirect3DDevice9_GetVertexShaderConstantF(device, 7, out, 1); + ok(out[0] == 0.0f && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f, + "The variable f4 was not set correctly by ID3DXConstantTable_SetFloat, " + "got {%f, %f, %f, %f}, should be all 0.0f\n", + out[0], out[1], out[2], out[3]); + refcnt = ID3DXConstantTable_Release(ctable); ok(refcnt == 0, "The constant table reference count was %u, should be 0\n", refcnt); }
1
0
0
0
Józef Kucia : d3dx9: ID3DXConstantTable:: SetVector shouldn't change the value of matrix constants.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: 2f73fd6ed506111633bb0c3515539ef261233d17 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f73fd6ed506111633bb0c351…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Tue Aug 21 14:52:15 2012 +0200 d3dx9: ID3DXConstantTable::SetVector shouldn't change the value of matrix constants. --- dlls/d3dx9_36/shader.c | 3 +++ dlls/d3dx9_36/tests/shader.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index faab0a4..d5d5018 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -921,6 +921,9 @@ static HRESULT set_vector_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev return D3DERR_INVALIDCALL; } + if (desc.Class == D3DXPC_MATRIX_ROWS || desc.Class == D3DXPC_MATRIX_COLUMNS) + return D3D_OK; + switch (desc.RegisterSet) { case D3DXRS_FLOAT4: diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c index 916136e..12725f2 100644 --- a/dlls/d3dx9_36/tests/shader.c +++ b/dlls/d3dx9_36/tests/shader.c @@ -646,6 +646,27 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) "The variable f was not set correctly by ID3DXConstantTable_SetMatrix, got %f, should be %f\n", out[0], U(S(mvp))._11); + /* Clear registers */ + memset(out, 0, sizeof(out)); + IDirect3DDevice9_SetVertexShaderConstantF(device, 0, out, 4); + + /* SetVector shouldn't change the value of a matrix constant */ + res = ID3DXConstantTable_SetVector(ctable, device, "mvp", &f4); + ok(res == D3D_OK, "ID3DXConstantTable_SetVector failed on variable f: 0x%08x\n", res); + + IDirect3DDevice9_GetVertexShaderConstantF(device, 0, out, 4); + ok(out[0] == 0.0f && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f + && out[4] == 0.0f && out[5] == 0.0f && out[6] == 0.0f && out[7] == 0.0f + && out[8] == 0.0f && out[9] == 0.0f && out[10] == 0.0f && out[11] == 0.0f + && out[12] == 0.0f && out[13] == 0.0f && out[14] == 0.0f && out[15] == 0.0f, + "The variable mvp was not set correctly by ID3DXConstantTable_SetVector, " + "got {%f, %f, %f, %f; %f, %f, %f, %f; %f, %f, %f %f; %f, %f, %f, %f}, " + "should be all 0.0f\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], + out[12], out[13], out[14], out[15]); + refcnt = ID3DXConstantTable_Release(ctable); ok(refcnt == 0, "The constant table reference count was %u, should be 0\n", refcnt); }
1
0
0
0
Józef Kucia : d3dx9: ID3DXConstantTable:: SetMatrix should set scalar constants.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: 978971e1ac364ba3734eb7290ae3747dc0cadf17 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=978971e1ac364ba3734eb7290…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Tue Aug 21 14:52:14 2012 +0200 d3dx9: ID3DXConstantTable::SetMatrix should set scalar constants. --- dlls/d3dx9_36/shader.c | 6 ++++++ dlls/d3dx9_36/tests/shader.c | 10 ++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c index 9482518..faab0a4 100644 --- a/dlls/d3dx9_36/shader.c +++ b/dlls/d3dx9_36/shader.c @@ -988,6 +988,12 @@ static HRESULT set_matrix_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev row_offset = 4; registers_per_matrix = desc.Rows; } + else if (desc.Class == D3DXPC_SCALAR) + { + column_offset = 1; + row_offset = 1; + registers_per_matrix = 1; + } else { FIXME("Unhandled variable class %#x\n", desc.Class); diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c index 8bfea43..916136e 100644 --- a/dlls/d3dx9_36/tests/shader.c +++ b/dlls/d3dx9_36/tests/shader.c @@ -636,6 +636,16 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) "The variable f was not set correctly by ID3DXConstantTable_SetVector, got %f, should be %f\n", out[0], f4.x); + memset(out, 0, sizeof(out)); + IDirect3DDevice9_SetVertexShaderConstantF(device, 6, out, 1); + res = ID3DXConstantTable_SetMatrix(ctable, device, "f", &mvp); + ok(res == D3D_OK, "ID3DXConstantTable_SetMatrix 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_SetMatrix, got %f, should be %f\n", + out[0], U(S(mvp))._11); + refcnt = ID3DXConstantTable_Release(ctable); ok(refcnt == 0, "The constant table reference count was %u, should be 0\n", refcnt); }
1
0
0
0
Rico Schüller : d3dx9: Avoid TRUE : FALSE conditional expression.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: 77993a610e80ca716df809d0424ac35409df7b05 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=77993a610e80ca716df809d04…
Author: Rico Schüller <kgbricola(a)web.de> Date: Tue Aug 21 12:26:45 2012 +0200 d3dx9: Avoid TRUE : FALSE conditional expression. --- dlls/d3dx9_36/effect.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index b54c398..53c94bc 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -903,7 +903,7 @@ inline static FLOAT get_float(D3DXPARAMETER_TYPE type, LPCVOID data) static inline BOOL get_bool(LPCVOID data) { - return (*(DWORD *)data) ? TRUE : FALSE; + return (*(DWORD *)data) != 0; } static void set_number(LPVOID outdata, D3DXPARAMETER_TYPE outtype, LPCVOID indata, D3DXPARAMETER_TYPE intype) @@ -1735,7 +1735,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_SetBool(ID3DXBaseEffect *iface, D3DXHA if (param && !param->element_count && param->rows == 1 && param->columns == 1) { /* crop input */ - b = b ? TRUE : FALSE; + b = b != 0; set_number(param->data, param->type, &b, D3DXPT_BOOL); return D3D_OK; }
1
0
0
0
Rico Schüller : d3dx9: Remove not needed TRACE.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: becf83fd86aea090916fc596462fb371ff308aca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=becf83fd86aea090916fc5964…
Author: Rico Schüller <kgbricola(a)web.de> Date: Tue Aug 21 12:26:40 2012 +0200 d3dx9: Remove not needed TRACE. --- dlls/d3dx9_36/effect.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 72d44e7..b54c398 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -456,11 +456,7 @@ static struct d3dx_technique *get_technique_by_name(struct ID3DXBaseEffectImpl * { struct d3dx_technique *tech = get_technique_struct(base->technique_handles[i]); - if (!strcmp(tech->name, name)) - { - TRACE("Returning technique %p\n", tech); - return tech; - } + if (!strcmp(tech->name, name)) return tech; } return NULL;
1
0
0
0
Rico Schüller : d3dx9: Identify D3DTSS_CONSTANT and FVF states.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: 892308fdb68ed9a511c049065904babd276ac0bc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=892308fdb68ed9a511c049065…
Author: Rico Schüller <kgbricola(a)web.de> Date: Tue Aug 21 12:26:33 2012 +0200 d3dx9: Identify D3DTSS_CONSTANT and FVF states. --- dlls/d3dx9_36/effect.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index d385015..72d44e7 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -324,12 +324,11 @@ state_table[] = {SC_TEXTURESTAGE, D3DTSS_BUMPENVLSCALE, "D3DTSS_BUMPENVLSCALE"}, {SC_TEXTURESTAGE, D3DTSS_BUMPENVLOFFSET, "D3DTSS_BUMPENVLOFFSET"}, {SC_TEXTURESTAGE, D3DTSS_TEXTURETRANSFORMFLAGS, "D3DTSS_TEXTURETRANSFORMFLAGS"}, - /* */ - {SC_UNKNOWN, 0, "UNKNOWN"}, + {SC_TEXTURESTAGE, D3DTSS_CONSTANT, "D3DTSS_CONSTANT"}, /* NPatchMode */ {SC_NPATCHMODE, 0, "NPatchMode"}, - /* */ - {SC_UNKNOWN, 0, "UNKNOWN"}, + /* FVF */ + {SC_FVF, 0, "FVF"}, /* Transform */ {SC_TRANSFORM, D3DTS_PROJECTION, "D3DTS_PROJECTION"}, {SC_TRANSFORM, D3DTS_VIEW, "D3DTS_VIEW"},
1
0
0
0
Rico Schüller : d3dx9: Don' t double check the technique.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: f9a4a9db1b3ca802cfe2dbd75a8e8257750324a3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f9a4a9db1b3ca802cfe2dbd75…
Author: Rico Schüller <kgbricola(a)web.de> Date: Tue Aug 21 12:26:22 2012 +0200 d3dx9: Don't double check the technique. --- dlls/d3dx9_36/effect.c | 16 +++------------- 1 files changed, 3 insertions(+), 13 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index ef8fb86..d385015 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -3527,19 +3527,9 @@ static HRESULT WINAPI ID3DXEffectImpl_SetTechnique(ID3DXEffect *iface, D3DXHANDL if (tech) { - UINT i; - - for (i = 0; i < base->technique_count; ++i) - { - struct d3dx_technique *t = get_technique_struct(base->technique_handles[i]); - - if (tech == t) - { - This->active_technique = get_technique_handle(t); - TRACE("Technique %u (%p)\n", i, tech); - return D3D_OK; - } - } + This->active_technique = get_technique_handle(tech); + TRACE("Technique %p\n", tech); + return D3D_OK; } WARN("Invalid argument supplied.\n");
1
0
0
0
Alexandre Julliard : gdi32: Allow removing a driver from the stack based on its function table.
by Alexandre Julliard
21 Aug '12
21 Aug '12
Module: wine Branch: master Commit: bf528c5e9cba7ee95427c924b7d1ae7af50d0a8c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf528c5e9cba7ee95427c924b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 21 12:59:18 2012 +0200 gdi32: Allow removing a driver from the stack based on its function table. --- dlls/gdi32/gdi_private.h | 7 ++++--- dlls/gdi32/path.c | 46 ++++++++++++++++------------------------------ 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 78ff1a7..bb1a5d1 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -170,11 +170,12 @@ static inline INT GDI_ROUND(double val) #define GET_DC_PHYSDEV(dc,func) \ get_physdev_entry_point( (dc)->physDev, FIELD_OFFSET(struct gdi_dc_funcs,func)) -static inline PHYSDEV pop_dc_driver( DC *dc, PHYSDEV dev ) +static inline PHYSDEV pop_dc_driver( DC *dc, const struct gdi_dc_funcs *funcs ) { - PHYSDEV *pdev = &dc->physDev; - while (*pdev && *pdev != dev) pdev = &(*pdev)->next; + PHYSDEV dev, *pdev = &dc->physDev; + while (*pdev && (*pdev)->funcs != funcs) pdev = &(*pdev)->next; if (!*pdev) return NULL; + dev = *pdev; *pdev = dev->next; return dev; } diff --git a/dlls/gdi32/path.c b/dlls/gdi32/path.c index a58f4e6..11e5e07 100644 --- a/dlls/gdi32/path.c +++ b/dlls/gdi32/path.c @@ -101,21 +101,6 @@ static inline struct path_physdev *get_path_physdev( PHYSDEV dev ) return (struct path_physdev *)dev; } -static inline void pop_path_driver( DC *dc, struct path_physdev *physdev ) -{ - pop_dc_driver( dc, &physdev->dev ); - HeapFree( GetProcessHeap(), 0, physdev ); -} - -static inline struct path_physdev *find_path_physdev( DC *dc ) -{ - PHYSDEV dev; - - for (dev = dc->physDev; dev->funcs != &null_driver; dev = dev->next) - if (dev->funcs == &path_driver) return get_path_physdev( dev ); - return NULL; -} - void free_gdi_path( struct gdi_path *path ) { HeapFree( GetProcessHeap(), 0, path->points ); @@ -805,7 +790,8 @@ static BOOL pathdrv_AbortPath( PHYSDEV dev ) if (!dc) return FALSE; free_gdi_path( physdev->path ); - pop_path_driver( dc, physdev ); + pop_dc_driver( dc, &path_driver ); + HeapFree( GetProcessHeap(), 0, physdev ); release_dc_ptr( dc ); return TRUE; } @@ -821,7 +807,8 @@ static BOOL pathdrv_EndPath( PHYSDEV dev ) if (!dc) return FALSE; dc->path = physdev->path; - pop_path_driver( dc, physdev ); + pop_dc_driver( dc, &path_driver ); + HeapFree( GetProcessHeap(), 0, physdev ); release_dc_ptr( dc ); return TRUE; } @@ -874,26 +861,25 @@ BOOL PATH_SavePath( DC *dst, DC *src ) BOOL PATH_RestorePath( DC *dst, DC *src ) { - struct path_physdev *physdev = find_path_physdev( dst ); + PHYSDEV dev; + struct path_physdev *physdev; - if (src->path && src->path_open) + if ((dev = pop_dc_driver( dst, &path_driver ))) { - if (!physdev) - { - if (!path_driver.pCreateDC( &dst->physDev, NULL, NULL, NULL, NULL )) return FALSE; - physdev = get_path_physdev( find_dc_driver( dst, &path_driver )); - } - else free_gdi_path( physdev->path ); + physdev = get_path_physdev( dev ); + free_gdi_path( physdev->path ); + HeapFree( GetProcessHeap(), 0, physdev ); + } + if (src->path && src->path_open) + { + if (!path_driver.pCreateDC( &dst->physDev, NULL, NULL, NULL, NULL )) return FALSE; + physdev = get_path_physdev( find_dc_driver( dst, &path_driver )); physdev->path = src->path; src->path_open = FALSE; src->path = NULL; } - else if (physdev) - { - free_gdi_path( physdev->path ); - pop_path_driver( dst, physdev ); - } + if (dst->path) free_gdi_path( dst->path ); dst->path = src->path; src->path = NULL;
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
55
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Results per page:
10
25
50
100
200