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
aaac25dc
Commit
aaac25dc
authored
Aug 21, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Aug 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: ID3DXConstantTable::SetFloat shouldn't change the value of matrix and vector constants.
parent
2f73fd6e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
shader.c
dlls/d3dx9_36/shader.c
+3
-0
shader.c
dlls/d3dx9_36/tests/shader.c
+27
-1
No files found.
dlls/d3dx9_36/shader.c
View file @
aaac25dc
...
@@ -873,6 +873,9 @@ static HRESULT set_scalar_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev
...
@@ -873,6 +873,9 @@ static HRESULT set_scalar_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev
return
D3DERR_INVALIDCALL
;
return
D3DERR_INVALIDCALL
;
}
}
if
(
desc
.
Class
!=
D3DXPC_SCALAR
)
return
D3D_OK
;
switch
(
desc
.
RegisterSet
)
switch
(
desc
.
RegisterSet
)
{
{
case
D3DXRS_FLOAT4
:
case
D3DXRS_FLOAT4
:
...
...
dlls/d3dx9_36/tests/shader.c
View file @
aaac25dc
...
@@ -623,7 +623,7 @@ static void test_setting_basic_table(IDirect3DDevice9 *device)
...
@@ -623,7 +623,7 @@ static void test_setting_basic_table(IDirect3DDevice9 *device)
out
[
0
],
out
[
1
],
out
[
2
],
out
[
3
],
f
);
out
[
0
],
out
[
1
],
out
[
2
],
out
[
3
],
f
);
IDirect3DDevice9_GetVertexShaderConstantF
(
device
,
7
,
out
,
1
);
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
"
,
"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
);
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)
...
@@ -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
,
7
,
out
,
1
);
/* SetVector shouldn't change the value of a matrix constant */
/* SetVector shouldn't change the value of a matrix constant */
res
=
ID3DXConstantTable_SetVector
(
ctable
,
device
,
"mvp"
,
&
f4
);
res
=
ID3DXConstantTable_SetVector
(
ctable
,
device
,
"mvp"
,
&
f4
);
...
@@ -667,6 +668,31 @@ static void test_setting_basic_table(IDirect3DDevice9 *device)
...
@@ -667,6 +668,31 @@ static void test_setting_basic_table(IDirect3DDevice9 *device)
out
[
8
],
out
[
9
],
out
[
10
],
out
[
11
],
out
[
8
],
out
[
9
],
out
[
10
],
out
[
11
],
out
[
12
],
out
[
13
],
out
[
14
],
out
[
15
]);
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
.
0
f
&&
out
[
1
]
==
0
.
0
f
&&
out
[
2
]
==
0
.
0
f
&&
out
[
3
]
==
0
.
0
f
&&
out
[
4
]
==
0
.
0
f
&&
out
[
5
]
==
0
.
0
f
&&
out
[
6
]
==
0
.
0
f
&&
out
[
7
]
==
0
.
0
f
&&
out
[
8
]
==
0
.
0
f
&&
out
[
9
]
==
0
.
0
f
&&
out
[
10
]
==
0
.
0
f
&&
out
[
11
]
==
0
.
0
f
&&
out
[
12
]
==
0
.
0
f
&&
out
[
13
]
==
0
.
0
f
&&
out
[
14
]
==
0
.
0
f
&&
out
[
15
]
==
0
.
0
f
,
"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
.
0
f
&&
out
[
1
]
==
0
.
0
f
&&
out
[
2
]
==
0
.
0
f
&&
out
[
3
]
==
0
.
0
f
,
"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
);
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
);
}
}
...
...
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