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
893b0b9d
Commit
893b0b9d
authored
Feb 11, 2010
by
Rico Schüller
Committed by
Alexandre Julliard
Feb 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10/tests: Use a wrapper function for D3D10CreateEffectFromMemory().
parent
f7879b43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
effect.c
dlls/d3d10/tests/effect.c
+19
-14
No files found.
dlls/d3d10/tests/effect.c
View file @
893b0b9d
...
@@ -42,6 +42,19 @@ static ID3D10Device *create_device(void)
...
@@ -42,6 +42,19 @@ static ID3D10Device *create_device(void)
return
NULL
;
return
NULL
;
}
}
static
inline
HRESULT
create_effect
(
DWORD
*
data
,
UINT
flags
,
ID3D10Device
*
device
,
ID3D10EffectPool
*
effect_pool
,
ID3D10Effect
**
effect
)
{
/*
* Don't use sizeof(data), use data[6] as size,
* because the DWORD data[] has only complete DWORDs and
* so it could happen that there are padded bytes at the end.
*
* The fx size (data[6]) could be up to 3 BYTEs smaller
* than the sizeof(data).
*/
return
D3D10CreateEffectFromMemory
(
data
,
data
[
6
],
flags
,
device
,
effect_pool
,
effect
);
}
/*
/*
* test_effect_constant_buffer_type
* test_effect_constant_buffer_type
*/
*/
...
@@ -82,15 +95,7 @@ static void test_effect_constant_buffer_type(ID3D10Device *device)
...
@@ -82,15 +95,7 @@ static void test_effect_constant_buffer_type(ID3D10Device *device)
LPCSTR
string
;
LPCSTR
string
;
unsigned
int
i
;
unsigned
int
i
;
/*
hr
=
create_effect
(
fx_test_ecbt
,
0
,
device
,
NULL
,
&
effect
);
* Don't use sizeof(fx_test_ecbt), use fx_test_ecbt[6] as size,
* because the DWORD fx_test_ecbt[] has only complete DWORDs and
* so it could happen that there are padded bytes at the end.
*
* The fx size (fx_test_ecbt[6]) could be up to 3 BYTEs smaller
* than the sizeof(fx_test_ecbt).
*/
hr
=
D3D10CreateEffectFromMemory
(
fx_test_ecbt
,
fx_test_ecbt
[
6
],
0
,
device
,
NULL
,
&
effect
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
constantbuffer
=
effect
->
lpVtbl
->
GetConstantBufferByIndex
(
effect
,
0
);
constantbuffer
=
effect
->
lpVtbl
->
GetConstantBufferByIndex
(
effect
,
0
);
...
@@ -252,7 +257,7 @@ static void test_effect_variable_type(ID3D10Device *device)
...
@@ -252,7 +257,7 @@ static void test_effect_variable_type(ID3D10Device *device)
LPCSTR
string
;
LPCSTR
string
;
unsigned
int
i
;
unsigned
int
i
;
hr
=
D3D10CreateEffectFromMemory
(
fx_test_evt
,
fx_test_evt
[
6
]
,
0
,
device
,
NULL
,
&
effect
);
hr
=
create_effect
(
fx_test_evt
,
0
,
device
,
NULL
,
&
effect
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
constantbuffer
=
effect
->
lpVtbl
->
GetConstantBufferByIndex
(
effect
,
0
);
constantbuffer
=
effect
->
lpVtbl
->
GetConstantBufferByIndex
(
effect
,
0
);
...
@@ -472,7 +477,7 @@ static void test_effect_variable_member(ID3D10Device *device)
...
@@ -472,7 +477,7 @@ static void test_effect_variable_member(ID3D10Device *device)
D3D10_EFFECT_VARIABLE_DESC
desc
;
D3D10_EFFECT_VARIABLE_DESC
desc
;
HRESULT
hr
;
HRESULT
hr
;
hr
=
D3D10CreateEffectFromMemory
(
fx_test_evm
,
fx_test_evm
[
6
]
,
0
,
device
,
NULL
,
&
effect
);
hr
=
create_effect
(
fx_test_evm
,
0
,
device
,
NULL
,
&
effect
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
constantbuffer
=
effect
->
lpVtbl
->
GetConstantBufferByIndex
(
effect
,
0
);
constantbuffer
=
effect
->
lpVtbl
->
GetConstantBufferByIndex
(
effect
,
0
);
...
@@ -662,7 +667,7 @@ static void test_effect_variable_element(ID3D10Device *device)
...
@@ -662,7 +667,7 @@ static void test_effect_variable_element(ID3D10Device *device)
D3D10_EFFECT_TYPE_DESC
type_desc
;
D3D10_EFFECT_TYPE_DESC
type_desc
;
HRESULT
hr
;
HRESULT
hr
;
hr
=
D3D10CreateEffectFromMemory
(
fx_test_eve
,
fx_test_eve
[
6
]
,
0
,
device
,
NULL
,
&
effect
);
hr
=
create_effect
(
fx_test_eve
,
0
,
device
,
NULL
,
&
effect
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
constantbuffer
=
effect
->
lpVtbl
->
GetConstantBufferByIndex
(
effect
,
0
);
constantbuffer
=
effect
->
lpVtbl
->
GetConstantBufferByIndex
(
effect
,
0
);
...
@@ -1347,7 +1352,7 @@ static void test_effect_variable_type_class(ID3D10Device *device)
...
@@ -1347,7 +1352,7 @@ static void test_effect_variable_type_class(ID3D10Device *device)
HRESULT
hr
;
HRESULT
hr
;
unsigned
int
variable_nr
=
0
;
unsigned
int
variable_nr
=
0
;
hr
=
D3D10CreateEffectFromMemory
(
fx_test_evtc
,
fx_test_evtc
[
6
]
,
0
,
device
,
NULL
,
&
effect
);
hr
=
create_effect
(
fx_test_evtc
,
0
,
device
,
NULL
,
&
effect
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
/* get the null_constantbuffer, so that we can compare it to variables->GetParentConstantBuffer */
/* get the null_constantbuffer, so that we can compare it to variables->GetParentConstantBuffer */
...
@@ -2359,7 +2364,7 @@ static void test_effect_constant_buffer_stride(ID3D10Device *device)
...
@@ -2359,7 +2364,7 @@ static void test_effect_constant_buffer_stride(ID3D10Device *device)
{
1
,
0x10
,
0x20
,
0x20
},
{
1
,
0x10
,
0x20
,
0x20
},
};
};
hr
=
D3D10CreateEffectFromMemory
(
fx_test_ecbs
,
fx_test_ecbs
[
6
]
,
0
,
device
,
NULL
,
&
effect
);
hr
=
create_effect
(
fx_test_ecbs
,
0
,
device
,
NULL
,
&
effect
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"D3D10CreateEffectFromMemory failed (%x)
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
tv_ecbs
)
/
sizeof
(
tv_ecbs
[
0
]);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
tv_ecbs
)
/
sizeof
(
tv_ecbs
[
0
]);
i
++
)
...
...
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