Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b31b9864
Commit
b31b9864
authored
Aug 16, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Aug 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Fix ID3DXConstantTable::SetMatrix.
parent
53ce2a24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
40 deletions
+8
-40
shader.c
dlls/d3dx9_36/shader.c
+2
-34
shader.c
dlls/d3dx9_36/tests/shader.c
+6
-6
No files found.
dlls/d3dx9_36/shader.c
View file @
b31b9864
...
...
@@ -1178,7 +1178,7 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrix(ID3DXConstantTable *iface
TRACE
(
"(%p)->(%p, %p, %p)
\n
"
,
This
,
device
,
constant
,
matrix
);
return
ID3DXConstantTable_SetMatrixArray
(
iface
,
device
,
constant
,
matrix
,
1
);
return
set_matrix_array
(
iface
,
device
,
constant
,
matrix
,
1
,
D3DXPT_FLOAT
,
4
,
4
);
}
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetMatrixArray
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
...
...
@@ -1186,41 +1186,9 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixArray(ID3DXConstantTable *
{
struct
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
D3DXCONSTANT_DESC
desc
;
HRESULT
hr
;
UINT
i
,
desc_count
=
1
;
D3DXMATRIX
temp
;
TRACE
(
"(%p)->(%p, %p, %p, %d)
\n
"
,
This
,
device
,
constant
,
matrix
,
count
);
hr
=
ID3DXConstantTable_GetConstantDesc
(
iface
,
constant
,
&
desc
,
&
desc_count
);
if
(
FAILED
(
hr
))
{
TRACE
(
"ID3DXConstantTable_GetConstantDesc failed: %08x
\n
"
,
hr
);
return
D3DERR_INVALIDCALL
;
}
switch
(
desc
.
RegisterSet
)
{
case
D3DXRS_FLOAT4
:
/* i * 4 + 3 is the last register we set. The conditional makes sure that we don't access
registers we're not supposed to */
for
(
i
=
0
;
i
<
count
&&
i
*
4
+
3
<
desc
.
RegisterCount
;
i
++
)
{
if
(
desc
.
Class
==
D3DXPC_MATRIX_ROWS
)
temp
=
matrix
[
i
];
else
D3DXMatrixTranspose
(
&
temp
,
&
matrix
[
i
]);
set_float_shader_constant
(
This
,
device
,
desc
.
RegisterIndex
+
i
*
4
,
&
temp
.
u
.
s
.
_11
,
4
);
}
break
;
default:
FIXME
(
"Handle other register sets
\n
"
);
return
E_NOTIMPL
;
}
return
D3D_OK
;
return
set_matrix_array
(
iface
,
device
,
constant
,
matrix
,
count
,
D3DXPT_FLOAT
,
4
,
4
);
}
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetMatrixPointerArray
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
...
...
dlls/d3dx9_36/tests/shader.c
View file @
b31b9864
...
...
@@ -674,7 +674,7 @@ static void test_setting_matrices_table(IDirect3DDevice9 *device)
(
int
)
S
(
U
(
fmatrix
)).
_21
,
(
int
)
S
(
U
(
fmatrix
)).
_22
,
(
int
)
S
(
U
(
fmatrix
)).
_23
,
0
);
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
7
,
out
,
1
);
todo_wine
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
2
]
==
S
(
U
(
fmatrix
)).
_31
&&
out
[
3
]
==
0
.
0
f
,
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
2
]
==
S
(
U
(
fmatrix
)).
_31
&&
out
[
3
]
==
0
.
0
f
,
"The variable fmatrix3x1 was not set correctly, out={%f, %f, %f, %f}, should be {%f, %f, %f, %f}
\n
"
,
out
[
0
],
out
[
1
],
out
[
2
],
out
[
3
],
S
(
U
(
fmatrix
)).
_11
,
S
(
U
(
fmatrix
)).
_21
,
S
(
U
(
fmatrix
)).
_31
,
0
.
0
f
);
...
...
@@ -700,7 +700,7 @@ static void test_setting_matrices_table(IDirect3DDevice9 *device)
ok
(
res
==
D3D_OK
,
"ID3DXConstantTable_SetMatrix failed on variable c3x3: got %#x
\n
"
,
res
);
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
7
,
out
,
3
);
todo_wine
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
2
]
==
0
.
0
f
&&
out
[
3
]
==
0
.
0
f
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
2
]
==
0
.
0
f
&&
out
[
3
]
==
0
.
0
f
&&
out
[
4
]
==
S
(
U
(
fmatrix
)).
_12
&&
out
[
5
]
==
S
(
U
(
fmatrix
)).
_22
&&
out
[
6
]
==
0
.
0
f
&&
out
[
7
]
==
0
.
0
f
&&
out
[
8
]
==
S
(
U
(
fmatrix
)).
_13
&&
out
[
9
]
==
S
(
U
(
fmatrix
)).
_23
&&
out
[
10
]
==
0
.
0
f
&&
out
[
11
]
==
0
.
0
f
,
"The variable c2x3 was not set correctly, out={%f, %f, %f, %f; %f, %f, %f, %f; %f, %f, %f, %f}, "
...
...
@@ -716,7 +716,7 @@ static void test_setting_matrices_table(IDirect3DDevice9 *device)
ok
(
res
==
D3D_OK
,
"ID3DXConstantTable_SetMatrix failed on variable r4x4: got %#x
\n
"
,
res
);
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
15
,
out
,
2
);
todo_wine
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_12
&&
out
[
2
]
==
S
(
U
(
fmatrix
)).
_13
&&
out
[
3
]
==
0
.
0
f
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_12
&&
out
[
2
]
==
S
(
U
(
fmatrix
)).
_13
&&
out
[
3
]
==
0
.
0
f
&&
out
[
4
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
5
]
==
S
(
U
(
fmatrix
)).
_22
&&
out
[
6
]
==
S
(
U
(
fmatrix
)).
_23
&&
out
[
7
]
==
0
.
0
f
,
"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
"
,
...
...
@@ -725,7 +725,7 @@ static void test_setting_matrices_table(IDirect3DDevice9 *device)
S
(
U
(
fmatrix
)).
_21
,
S
(
U
(
fmatrix
)).
_22
,
S
(
U
(
fmatrix
)).
_23
,
0
.
0
f
);
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
13
,
out
,
2
);
todo_wine
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
2
]
==
S
(
U
(
fmatrix
)).
_31
&&
out
[
3
]
==
0
.
0
f
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
2
]
==
S
(
U
(
fmatrix
)).
_31
&&
out
[
3
]
==
0
.
0
f
&&
out
[
4
]
==
S
(
U
(
fmatrix
)).
_12
&&
out
[
5
]
==
S
(
U
(
fmatrix
)).
_22
&&
out
[
6
]
==
S
(
U
(
fmatrix
)).
_32
&&
out
[
7
]
==
0
.
0
f
,
"The variable c3x2 was not set correctly, out={%f, %f, %f, %f; %f, %f, %f, %f}, "
"should be {%f, %f, %f, %f; %f, %f, %f, %f}
\n
"
,
...
...
@@ -734,7 +734,7 @@ static void test_setting_matrices_table(IDirect3DDevice9 *device)
S
(
U
(
fmatrix
)).
_12
,
S
(
U
(
fmatrix
)).
_22
,
S
(
U
(
fmatrix
)).
_32
,
0
.
0
f
);
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
4
,
out
,
3
);
todo_wine
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_12
&&
out
[
2
]
==
0
.
0
f
&&
out
[
3
]
==
0
.
0
f
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_12
&&
out
[
2
]
==
0
.
0
f
&&
out
[
3
]
==
0
.
0
f
&&
out
[
4
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
5
]
==
S
(
U
(
fmatrix
)).
_22
&&
out
[
6
]
==
0
.
0
f
&&
out
[
7
]
==
0
.
0
f
&&
out
[
8
]
==
S
(
U
(
fmatrix
)).
_31
&&
out
[
9
]
==
S
(
U
(
fmatrix
)).
_32
&&
out
[
10
]
==
0
.
0
f
&&
out
[
11
]
==
0
.
0
f
,
"The variable r3x2 was not set correctly, out={%f, %f, %f, %f; %f, %f, %f, %f; %f, %f, %f, %f}, "
...
...
@@ -745,7 +745,7 @@ static void test_setting_matrices_table(IDirect3DDevice9 *device)
S
(
U
(
fmatrix
)).
_31
,
S
(
U
(
fmatrix
)).
_32
,
0
.
0
f
,
0
.
0
f
);
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
10
,
out
,
3
);
todo_wine
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
2
]
==
S
(
U
(
fmatrix
)).
_31
&&
out
[
3
]
==
0
.
0
f
ok
(
out
[
0
]
==
S
(
U
(
fmatrix
)).
_11
&&
out
[
1
]
==
S
(
U
(
fmatrix
)).
_21
&&
out
[
2
]
==
S
(
U
(
fmatrix
)).
_31
&&
out
[
3
]
==
0
.
0
f
&&
out
[
4
]
==
S
(
U
(
fmatrix
)).
_12
&&
out
[
5
]
==
S
(
U
(
fmatrix
)).
_22
&&
out
[
6
]
==
S
(
U
(
fmatrix
)).
_32
&&
out
[
7
]
==
0
.
0
f
&&
out
[
8
]
==
S
(
U
(
fmatrix
)).
_13
&&
out
[
9
]
==
S
(
U
(
fmatrix
)).
_23
&&
out
[
10
]
==
S
(
U
(
fmatrix
)).
_33
&&
out
[
11
]
==
0
.
0
f
,
"The variable c3x3 was not set correctly, out={%f, %f, %f, %f; %f, %f, %f, %f; %f, %f, %f, %f}, "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment