Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
711ee8a7
Commit
711ee8a7
authored
Aug 14, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Aug 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Correctly handle constants without default values in D3DXGetShaderConstantTableEx.
parent
e67920f1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
shader.c
dlls/d3dx9_36/shader.c
+2
-1
shader.c
dlls/d3dx9_36/tests/shader.c
+20
-17
No files found.
dlls/d3dx9_36/shader.c
View file @
711ee8a7
...
...
@@ -1261,7 +1261,8 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(CONST DWORD *byte_code,
object
->
constants
[
i
].
desc
.
RegisterSet
=
constant_info
[
i
].
RegisterSet
;
object
->
constants
[
i
].
desc
.
RegisterIndex
=
constant_info
[
i
].
RegisterIndex
;
object
->
constants
[
i
].
desc
.
RegisterCount
=
constant_info
[
i
].
RegisterCount
;
object
->
constants
[
i
].
desc
.
DefaultValue
=
object
->
ctab
+
constant_info
[
i
].
DefaultValue
;
object
->
constants
[
i
].
desc
.
DefaultValue
=
constant_info
[
i
].
DefaultValue
?
object
->
ctab
+
constant_info
[
i
].
DefaultValue
:
NULL
;
hr
=
parse_ctab_constant_type
((
LPD3DXSHADER_TYPEINFO
)(
object
->
ctab
+
constant_info
[
i
].
TypeInfo
),
&
object
->
constants
[
i
]);
...
...
dlls/d3dx9_36/tests/shader.c
View file @
711ee8a7
...
...
@@ -93,11 +93,11 @@ static const DWORD ctab_basic[] = {
0x0000ffff
};
/* END */
static
const
D3DXCONSTANT_DESC
ctab_basic_expected
[]
=
{
{
"mvp"
,
D3DXRS_FLOAT4
,
0
,
4
,
D3DXPC_MATRIX_COLUMNS
,
D3DXPT_FLOAT
,
4
,
4
,
1
,
0
,
64
,
0
},
{
"i"
,
D3DXRS_FLOAT4
,
4
,
1
,
D3DXPC_SCALAR
,
D3DXPT_INT
,
1
,
1
,
1
,
0
,
4
,
0
},
{
"i4"
,
D3DXRS_FLOAT4
,
5
,
1
,
D3DXPC_VECTOR
,
D3DXPT_INT
,
1
,
4
,
1
,
0
,
16
,
0
},
{
"f"
,
D3DXRS_FLOAT4
,
6
,
1
,
D3DXPC_SCALAR
,
D3DXPT_FLOAT
,
1
,
1
,
1
,
0
,
4
,
0
},
{
"f4"
,
D3DXRS_FLOAT4
,
7
,
1
,
D3DXPC_VECTOR
,
D3DXPT_FLOAT
,
1
,
4
,
1
,
0
,
16
,
0
}};
{
"mvp"
,
D3DXRS_FLOAT4
,
0
,
4
,
D3DXPC_MATRIX_COLUMNS
,
D3DXPT_FLOAT
,
4
,
4
,
1
,
0
,
64
,
NULL
},
{
"i"
,
D3DXRS_FLOAT4
,
4
,
1
,
D3DXPC_SCALAR
,
D3DXPT_INT
,
1
,
1
,
1
,
0
,
4
,
NULL
},
{
"i4"
,
D3DXRS_FLOAT4
,
5
,
1
,
D3DXPC_VECTOR
,
D3DXPT_INT
,
1
,
4
,
1
,
0
,
16
,
NULL
},
{
"f"
,
D3DXRS_FLOAT4
,
6
,
1
,
D3DXPC_SCALAR
,
D3DXPT_FLOAT
,
1
,
1
,
1
,
0
,
4
,
NULL
},
{
"f4"
,
D3DXRS_FLOAT4
,
7
,
1
,
D3DXPC_VECTOR
,
D3DXPT_FLOAT
,
1
,
4
,
1
,
0
,
16
,
NULL
}};
static
const
DWORD
ctab_matrices
[]
=
{
0xfffe0300
,
/* vs_3_0 */
...
...
@@ -118,9 +118,9 @@ static const DWORD ctab_matrices[] = {
0x0000ffff
};
/* END */
static
const
D3DXCONSTANT_DESC
ctab_matrices_expected
[]
=
{
{
"fmatrix4x4"
,
D3DXRS_FLOAT4
,
0
,
4
,
D3DXPC_MATRIX_COLUMNS
,
D3DXPT_FLOAT
,
4
,
4
,
1
,
0
,
64
,
0
},
{
"imatrix2x3"
,
D3DXRS_FLOAT4
,
4
,
3
,
D3DXPC_MATRIX_ROWS
,
D3DXPT_INT
,
2
,
3
,
1
,
0
,
24
,
0
},
{
"fmatrix3x1"
,
D3DXRS_FLOAT4
,
7
,
1
,
D3DXPC_MATRIX_COLUMNS
,
D3DXPT_FLOAT
,
3
,
1
,
1
,
0
,
12
,
0
}};
{
"fmatrix4x4"
,
D3DXRS_FLOAT4
,
0
,
4
,
D3DXPC_MATRIX_COLUMNS
,
D3DXPT_FLOAT
,
4
,
4
,
1
,
0
,
64
,
NULL
},
{
"imatrix2x3"
,
D3DXRS_FLOAT4
,
4
,
3
,
D3DXPC_MATRIX_ROWS
,
D3DXPT_INT
,
2
,
3
,
1
,
0
,
24
,
NULL
},
{
"fmatrix3x1"
,
D3DXRS_FLOAT4
,
7
,
1
,
D3DXPC_MATRIX_COLUMNS
,
D3DXPT_FLOAT
,
3
,
1
,
1
,
0
,
12
,
NULL
}};
static
const
DWORD
ctab_arrays
[]
=
{
0xfffe0300
,
/* vs_3_0 */
...
...
@@ -150,12 +150,12 @@ static const DWORD ctab_arrays[] = {
0x0000ffff
};
/* END */
static
const
D3DXCONSTANT_DESC
ctab_arrays_expected
[]
=
{
{
"fmtxarray"
,
D3DXRS_FLOAT4
,
0
,
8
,
D3DXPC_MATRIX_ROWS
,
D3DXPT_FLOAT
,
4
,
4
,
2
,
0
,
128
,
0
},
{
"farray"
,
D3DXRS_FLOAT4
,
8
,
4
,
D3DXPC_SCALAR
,
D3DXPT_FLOAT
,
1
,
1
,
4
,
0
,
16
,
0
},
{
"fvecarray"
,
D3DXRS_FLOAT4
,
12
,
2
,
D3DXPC_VECTOR
,
D3DXPT_FLOAT
,
1
,
4
,
2
,
0
,
32
,
0
},
{
"barray"
,
D3DXRS_FLOAT4
,
14
,
2
,
D3DXPC_SCALAR
,
D3DXPT_BOOL
,
1
,
1
,
2
,
0
,
8
,
0
},
{
"bvecarray"
,
D3DXRS_FLOAT4
,
16
,
2
,
D3DXPC_VECTOR
,
D3DXPT_BOOL
,
1
,
3
,
3
,
0
,
36
,
0
},
{
"ivecarray"
,
D3DXRS_FLOAT4
,
18
,
1
,
D3DXPC_VECTOR
,
D3DXPT_INT
,
1
,
4
,
1
,
0
,
16
,
0
}};
{
"fmtxarray"
,
D3DXRS_FLOAT4
,
0
,
8
,
D3DXPC_MATRIX_ROWS
,
D3DXPT_FLOAT
,
4
,
4
,
2
,
0
,
128
,
NULL
},
{
"farray"
,
D3DXRS_FLOAT4
,
8
,
4
,
D3DXPC_SCALAR
,
D3DXPT_FLOAT
,
1
,
1
,
4
,
0
,
16
,
NULL
},
{
"fvecarray"
,
D3DXRS_FLOAT4
,
12
,
2
,
D3DXPC_VECTOR
,
D3DXPT_FLOAT
,
1
,
4
,
2
,
0
,
32
,
NULL
},
{
"barray"
,
D3DXRS_FLOAT4
,
14
,
2
,
D3DXPC_SCALAR
,
D3DXPT_BOOL
,
1
,
1
,
2
,
0
,
8
,
NULL
},
{
"bvecarray"
,
D3DXRS_FLOAT4
,
16
,
2
,
D3DXPC_VECTOR
,
D3DXPT_BOOL
,
1
,
3
,
3
,
0
,
36
,
NULL
},
{
"ivecarray"
,
D3DXRS_FLOAT4
,
18
,
1
,
D3DXPC_VECTOR
,
D3DXPT_INT
,
1
,
4
,
1
,
0
,
16
,
NULL
}};
static
const
DWORD
ctab_samplers
[]
=
{
0xfffe0300
,
/* vs_3_0 */
...
...
@@ -176,9 +176,9 @@ static const DWORD ctab_samplers[] = {
0x0000ffff
};
/* END */
static
const
D3DXCONSTANT_DESC
ctab_samplers_expected
[]
=
{
{
"sampler1"
,
D3DXRS_SAMPLER
,
0
,
1
,
D3DXPC_OBJECT
,
D3DXPT_SAMPLER2D
,
1
,
1
,
1
,
0
,
4
,
0
},
{
"sampler2"
,
D3DXRS_SAMPLER
,
3
,
1
,
D3DXPC_OBJECT
,
D3DXPT_SAMPLER3D
,
1
,
1
,
1
,
0
,
4
,
0
},
{
"notsampler"
,
D3DXRS_FLOAT4
,
2
,
1
,
D3DXPC_VECTOR
,
D3DXPT_FLOAT
,
1
,
4
,
1
,
0
,
16
,
0
}};
{
"sampler1"
,
D3DXRS_SAMPLER
,
0
,
1
,
D3DXPC_OBJECT
,
D3DXPT_SAMPLER2D
,
1
,
1
,
1
,
0
,
4
,
NULL
},
{
"sampler2"
,
D3DXRS_SAMPLER
,
3
,
1
,
D3DXPC_OBJECT
,
D3DXPT_SAMPLER3D
,
1
,
1
,
1
,
0
,
4
,
NULL
},
{
"notsampler"
,
D3DXRS_FLOAT4
,
2
,
1
,
D3DXPC_VECTOR
,
D3DXPT_FLOAT
,
1
,
4
,
1
,
0
,
16
,
NULL
}};
static
void
test_get_shader_size
(
void
)
{
...
...
@@ -437,6 +437,9 @@ static void test_constant_table(const char *test_name, const DWORD *ctable_fn,
ok
(
actual
.
Bytes
==
expected
->
Bytes
,
"%s in %s: Got different byte count: Got %d, expected %d
\n
"
,
expected
->
Name
,
test_name
,
actual
.
Bytes
,
expected
->
Bytes
);
ok
(
actual
.
DefaultValue
==
expected
->
DefaultValue
,
"%s in %s: Got different default value: Got %p, expected %p
\n
"
,
expected
->
Name
,
test_name
,
actual
.
DefaultValue
,
expected
->
DefaultValue
);
}
/* Finally, release the constant table */
...
...
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